Remove Interval

Medium · Intervals · about 15 minutes

Asked at Google, Amazon, Meta.

A sorted list of disjoint half-open intervals [a, b) represents a set of real numbers. Remove the interval toBeRemoved from the set and return the resulting sorted list of disjoint intervals.

Related guides