Intervals: [[1,3], [2,6], [8,10], [15,18]]. Sorted: [[1,3], [2,6], [8,10], [15,18]]. 1. Start result = [[1,3]].
2. [2,6]: 2 <= 3? Yes, overlap. Merge to [1, max(3,6)] = [1,6]. Result = [[1,6]].
3. [8,10]: 8 <= 6? No. Add new. Result = [[1,6], [8,10]].
4. [15,18]: 15 <= 10? No. Add new. Result = [[1,6], [8,10], [15,18]]. Notice how we only check against the last merged interval.