Merge Intervals
Hard · Algorithms
Each interval is [start, end] (inclusive end is not required; treat them as half-open or closed consistently — overlapping or touching intervals merge). Sort by start, then merge when the next start is <= current end.
Write Merge(intervals).
Next: Spiral Matrix