FAANG · LeetCode #252
Meeting Rooms — three-stage drill
1The ProblemEasy
Meeting Rooms
Can one person attend every meeting? — any overlap means no.
Examples
[[0,30],[5,10],[15,20]]→ false[[7,10],[2,4]]→ true
constraintMeetings are half-open intervals [start, end); a meeting ending at t and another starting at t do NOT overlap.
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 → true
Step through it
given: 3 meetings · can one person attend all of them?
Step 1 / 5
Arrow keys to navigate · escape to reset