Skip to content

Intervals

An interval is a time range like a meeting from 9 to 10. Questions are about overlaps: can you attend all, how many rooms, how to merge. Almost always the first move is to sort by start time, then sweep once.

After this topic: You can sort and sweep, decide when two ranges overlap, and know when a heap or a greedy "earliest end" rule is needed.

Do these first: Heap / Priority Queue

0 of 6 solved0%

Step 1 · Read the lesson

Intervals

Sort by start, then sweep and merge overlapping ranges.

Step 2 · Solve the problems in order

Try each one for about 20 minutes first. Problems with a Run code tab are checked right here. If you are stuck, open Nudge, think again, then Idea. Go skeleton only gives the function shape, and Reference solution is for comparing after you have tried. Tick the box when you could solve it again without help.

  1. 1.Insert IntervalMedium
  2. 2.Merge IntervalsMedium
  3. 3.Non-overlapping IntervalsMedium
  4. 4.Meeting RoomsEasy
  5. 5.Meeting Rooms IIMedium
  6. 6.Minimum Interval to Include Each QueryHard