Meeting Rooms Needed
Each meeting is [start, end); a meeting ending at time frees its room for a meeting starting at . Return the minimum number of rooms needed.
Examples
EXAMPLE WALKTHROUGHtwo rooms
A guided view of the published example, not a trace of your code.
INPUT
[[[0,30],[5,10],[15,20]]]TASKmeeting_rooms_needed()
EXPECTED OUTPUT
2Start with the input values shown in this example.
Example 1 of 3
Input: meetings = [[0,30],[5,10],[15,20]]
Output: 2
Explanation: two rooms
Input: meetings = [[7,10],[2,4]]
Output: 1
Explanation: one room
Input: meetings = []
Output: 0
Explanation: no meetings
Hint 1
Sort meetings by start; keep a min-heap of end times of rooms in use.
Hint 2
Alternatively sweep over sorted start and end times.