Given an array of meeting time intervals where intervals[i] = [start, end], return the minimum number of conference rooms required so that all meetings can take place without overlap. Pattern focus: Interval Scheduling. Track the earliest finishing meetings first, usually with a min-heap or a sweep over sorted start and end times.
intervals = list of meeting intervals [start, end]
minimum number of meeting rooms required
Example 1:
Input:
intervals = [[0,30],[5,10],[15,20]]
Output:
2
Explanation:
One room hosts [0,30], and the second room handles the two shorter meetings.
Example 2:
Input:
intervals = [[7,10],[2,4]]
Output:
1
Explanation:
The meetings do not overlap, so a single room is enough.
Example 3:
Input:
intervals = [[1,5],[2,6],[8,9]]
Output:
2
Explanation:
The first two meetings overlap, so two rooms are needed at peak time.