You are given a list of meetings, each with a start time and end time. A single room can host only one meeting at a time.
Two meetings overlap if one starts before the other ends (treat meetings as half-open intervals [start, end) so a meeting ending at time t does not conflict with another starting at time t).
Return the minimum number of rooms required to host all meetings.
intervals
: an array of
n
pairs
[start, end]
where
0 <= start <= end
.
1 <= n <= 200000
0 .. 10^9
).
[[0,30],[5,10],[15,20]]
2
(One room can host [0,30], the other can host [5,10] then [15,20].)