Meeting Rooms II
Problem statement
You are given meeting time intervals where each row [start, end] uses a half-open interval: a meeting occupies a room from start up to, but not including, end.
Return the minimum number of meeting rooms required so that every meeting can take place. A room whose meeting ends at time t may be reused by another meeting that starts at time t.
Function
minMeetingRooms(intervals: int[][]) → intExamples
Example 1
intervals = [[0,30],[5,10],[15,20]]return = 2The meeting [0,30] overlaps both shorter meetings, but the two shorter meetings do not overlap each other.
Example 2
intervals = [[7,10],[2,4]]return = 1The meetings are disjoint, so one room can host both.
Example 3
intervals = [[1,5],[5,9],[5,6]]return = 2The room used by [1,5] is available at time 5, while the two meetings beginning at 5 need two rooms together.
Constraints
0 <= intervals.length <= 100000.- Each interval has exactly two integers
[start, end]. 0 <= start < end <= 10^9.