Given an array of intervals, merge all overlapping intervals and return an array of non-overlapping intervals covering all input intervals.
Input: [[1,3],[2,6],[8,10],[15,18]] Output: [[1,6],[8,10],[15,18]]
Input: [[1,4],[4,5]] Output: [[1,5]]
Input: [[1,4],[2,3]] Output: [[1,4]]
Jnaneshwara Reddy Satti
Builder · ClearCode
Hi — I'm a 21yo CS grad from India. I built ClearCode while recovering from a surgery, because I genuinely believe DSA should be visual, free, and accessible to everyone. No VC funding. No team. Just me, my laptop, and a lot of chai. ☕
If ClearCode helped you understand even one concept — consider supporting it. Every rupee keeps the servers running and new videos coming.