Why it matters
Meeting rooms is common variant. Understanding shapes greedy application.
Advertisement
The architecture
Sort meetings by start.
PQ tracks end times.
Reuse room if earliest end <= start.
Advertisement
How it works end to end
Sort O(n log n).
PQ min-heap for room ends.
Reuse when possible; else add.