Sort intervals by start time.
Initialize result with the first interval.
For each remaining interval:
- If it overlaps with the last interval in result, extend the end.
- Otherwise, add it as a new interval.
Return result. Overlap condition: interval.start <= result.last.end. Time: . Space: . Common bug: forgetting to take max when merging ends, which loses the longer interval.