Largest Overlap of Intervals
You are given a list of intervals where each intervals[i] = [start, end] is a closed range. Several intervals may cover the same point at once.
Return the **largest number of intervals that overlap at any single point** — the peak number of simultaneously active intervals. Touching endpoints count as overlapping: [1, 3] and [3, 5] both cover the point 3, so at 3 two intervals are active.
Example cases
- triple stackin intervals =152637out 3At point 3, all three intervals are active, so the peak overlap is 3.
- disjointin intervals =123456out 1No two intervals share a point; the peak is 1.
- emptyin intervals = []out 0
Constraints
- 0 <= intervals.length <= 10^4
- intervals[i].length == 2
- 0 <= start <= end <= 10^9
intervals =
[[1,5],[2,6],[3,7]]