Given an array of intervals where intervals[i] = [start_i, end_i], merge all overlapping intervals and return an array of the non-overlapping intervals that cover all the intervals in the input.
Explanation: Intervals [1,3] and [2,6] overlap since 2 <= 3, so they merge into [1,6]. The remaining intervals [8,10] and [15,18] do not overlap.
Analyze constraints and compute optimal solutions step-by-step.
No dry run loaded.
🚀 Practice this problem
Run code, get AI hints & track streak