(This question is a variation of the LeetCode question 253. Meeting Rooms II. If you haven't completed that question yet, it is recommended to solve it first.)
You are given a list of closed intervals on the number line, where each interval is represented as a pair [start, end] and includes both endpoints. Two intervals overlap at a point if that point lies in both intervals.
Determine the maximum number of intervals that overlap at any single point on the number line.
Constraints:
- 1 ≤
intervals.length≤ ≤intervals[i][0]≤intervals[i][1]≤
Example 1:
Input: intervals = [[1, 3], [2, 5], [4, 6]] Output: 2 Explanation: At point 2, the first two intervals [1, 3] and [2, 5] overlap. At point 4, the last two intervals [2, 5] and [4, 6] overlap. And no single point is covered by all three intervals.
Example 2:
Input: intervals = [[1, 2], [3, 4], [5, 6]] Output: 1
Example 3:
Input: intervals = [[1, 10], [2, 5], [3, 7], [8, 9]] Output: 3
