Given a collection of intervals, merge any overlapping intervals and return the resulting set of non-overlapping intervals.
Explanation: The intervals [1, 3] and [2, 6] overlap, so they are merged into [1, 6]. The remaining intervals do not overlap.
Explanation: Although the intervals [1, 4] and [4, 5] only share a boundary, they are still considered overlapping and are merged into [1, 5].
Overlapping interval consolidation
No dry run loaded.
🚀 Practice this problem
Run code, get AI hints & track streak