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