253. Meeting Rooms II (Approach 1)
Intitution
To find the minimum number of conference rooms required, we need to track how many meetings are happening simultaneously. A good way to do this is by sweeping through the timeline of all meeting start and end times:
Each time a meeting starts, a room is needed.
Each time a meeting ends, a room is freed.
By tracking the net changes in active meetings at every time point, we can figure out the peak number of overlapping meetings, which is our answer.
Complexity
Space Complexity
Time Complexity
Code
Last updated