FAANG · LeetCode #253
Meeting Rooms II — three-stage drill
1The ProblemMedium
Meeting Rooms II
Fewest rooms to fit every meeting — the peak number of concurrent meetings.
Examples
[[0,30],[5,10],[15,20]]→ 2[[7,10],[2,4]]→ 1
constraintHalf-open intervals — a meeting ending at t and another starting at t share a room (end event processed before start at equal t).
2The PatternTIME O(n log n) · SPACE O(n)
Intervals
Given a pile of ranges, sort them by start — now any overlap is a neighbour, so a single left→right pass handles them.
Problems using this pattern
3The SolutionRESULT → 3
Step through it
given: 4 meetings · how many rooms do we need so every meeting has one?
Step 1 / 11
Arrow keys to navigate · escape to reset