Optimization line
Intervals problems
Problems about ranges with a start and an end, such as meetings. Sorting them by start lines them up, so one pass finds every overlap and gap.
- 1 easy
- 4 medium
- 1 hard
The 6 problems
In the order the app teaches them. Each page has the problem, five hints and the explained solution.
- Insert IntervalMedium
- Merge IntervalsMedium
- Non Overlapping IntervalsMedium
- Meeting RoomsEasy
- Meeting Rooms IIMedium
- Minimum Interval to Include Each QueryHard
On the roadmap
Intervals is a station on the optimization line. It builds on Greedy. No line goes on from here.
The roadmap says why each line runs in its order.
Patterns
3 patterns solve these problems. Naming them gives the problems’ methods away, so the list is folded.
Show the 3
- Sorted interval sweep4 problems
- Greedy choice1 problem
- Heap as a priority queue1 problem