← All sections
Intervals
Sorting + greedy reasoning — a breather before the recursion block.
0/6 lessons · exam: 0/30%
Lessons
- ✓01
Recognizing interval problems
What an interval is, the first move (sorting), and the overlap condition.
- ✓02
Pattern 1: Sort and merge
Sort by start and scan, merging intervals that overlap.
- ✓03
Pattern 2: Insert into a sorted set
Insert an interval into an already-sorted list in three phases: before, merge, after.
- ✓04
Pattern 3: Greedy on overlap
Sort by end and keep the ones that fit — the greedy choice that maximizes the result.
- ✓05
Pattern 4: Event sweep (rooms)
Count the maximum overlap by treating starts and ends as events in time.
- ✓06
Synthesis: which pattern to use?
The decision tree of the Intervals section and the general quiz before the final exam.
1 easy + 1 medium + 1 hard — unseen problems
With hidden test cases, just like the real LeetCode. This is where you confirm you can leave the section solving any problem of the topic.