Meeting Rooms II
Given an array of meeting time intervals where intervals[i] = [start_i, end_i], return the minimum number of conference rooms required so that no two overlapping meetings share a room.
Open official problem prompt ↗Compute the peak number of meetings happening at the same instant, which equals the minimum rooms needed.
Like watching a parking lot: every arriving car needs a spot, and a spot frees only when a car leaves; the most cars parked at once is how many spots you must have.
- Input
- intervals = [[0,30],[5,10],[15,20]]
- Output
- 2
- Why
- [0,30] runs the whole time; [5,10] needs a second room, and [15,20] can reuse that second room after [5,10] ends.
1 <= intervals.length <= 10^40 <= start_i < end_i <= 10^6