Loading...
You are given an array intervals, where intervals[i] = [start, end] is a time interval with start < end.
All 2n endpoint values are distinct: no two intervals share a start or end time.
Return the maximum number of intervals that are active at the same moment (an interval is active from its start until its end).
Input: intervals = [[5,8],[2,4],[3,9]]
Output: 2
Explanation: Between times 5 and 8 both [5,8] and [3,9] are active. [2,4] overlaps only [3,9], so no moment has all three active.
Input: intervals = [[1,10],[2,9],[3,8],[4,7]]
Output: 4
Explanation: The intervals are nested, so between times 4 and 7 all four are active.
intervals.length ≤2⋅105intervals[i].length =2start < end ≤109Click "Run" to test with sample cases or "Submit" to run all tests.