Pattern Recognition Drill
Easy Intervals
The Problem
Given an array of meeting time intervals, determine if a person can attend all meetings.
What approach would you use?
Think about it before scrolling down.
Sort by start. If any interval starts before the previous ends, return False. O(n log n).
Merge intervals; if merged count < original count, there's overlap.
Common Trap
Don't check all pairs O(n²) — sorting first makes it a single linear scan.