arrayssorting
Merge intervals with one sweep
Anonymous
Sort intervals by start, then scan once. If the next interval overlaps the current one, extend the current end; otherwise, append the current interval and start a new one. The sort dominates at O(n log n), followed by an O(n) scan.
0