Skip to content
BytePatterns

Intervals

Sort by start, sweep once — merges, overlaps and meeting rooms fall out.

Intervals progress0 / 4
  1. Interval Basics & SortingSort by start and the pairwise question becomes a left-to-right scan.4m
  2. Merge IntervalsHold one block open, stretch it while they touch, close it on a gap.5m
  3. Insert IntervalThe list is already sorted, so slot the new block in with three passes.5m
  4. Meeting RoomsCount how many run at once; the high-water mark is the room count.5m

Quiz yourself: 3 questions from this module

1 / 3

Two intervals a and b overlap when: