Given meeting intervals [[start,end], ...], return the minimum number of rooms needed so no two overlapping meetings share a room. e.g. [[0,30],[5,10],[15,20]] → 2.
Reframing 'minimum resources' as 'maximum concurrent intervals' and computing it with a sweep or a heap.
The minimum rooms equals the maximum number of meetings happening at the same instant. Two standard solutions. (1) Min-heap of end times: sort meetings by start; for each meeting, if the earliest-ending room (heap top) is free by its start, reuse that room (pop); always push the current end. The heap size at the end is the peak concurrency. (2) Sweep line / two-pointer: split into sorted start times and sorted end times, walk both; a start before the next end needs a new room (rooms++, advance start), otherwise a meeting freed a room (rooms--, advance end) — track the running max. Both are O(n log n) dominated by the sort. This is the 'sort by start' interval family extended to a resource-counting question; the key reframing — 'min rooms = max overlap' — is exactly what the interviewer is checking. Same counting shows up in car-pooling and minimum-platforms.
Minimum concurrent resources for overlapping intervals → count max overlap via a min-heap of end times or a start/end sweep.
Time O(n log n) · Space O(n)