Advanced
Open
Pro
Largest Overlap of Intervals
You are given an array intervals where intervals[i] = [start_i, end_i]
represents a meeting that occupies the time range [start_i, end_i)
(the meeting ends before end_i, so a meeting ending at 10 does
not conflict with one starting at 10).
Return the minimum number of meeting rooms required to schedule all the meetings without conflicts — equivalently, the maximum number of intervals that are simultaneously active at any single point in time.
Example 1
Input: intervals = [[0, 30], [5, 10], [15, 20]]
Output: 2
Explanation: [0, 30] overlaps with [5, 10] and separately with
[15, 20], but [5, 10] and [15, 20] don't overlap each other, so at
most 2 meetings are ever happening at once.
Example 2
Input: intervals = [[7, 10], [2, 4]]
Output: 1
Explanation: The two meetings don't overlap at all.
Constraints
1 <= intervals.length <= 10^40 <= start_i < end_i <= 10^6
Share this question