Skip to content
Veltoryx Technologies
ProProblem 15● MediumLeetCode #56 ↗2 min readUpdated 30 October 2026

Merge Intervals

Merge overlapping ranges by sorting them by start and extending the last merged range while they overlap.

01The problem

Given intervals [start, end], merge all that overlap and return the result.

InputOutput
[[1,3],[2,6],[8,10],[15,18]][[1,6],[8,10],[15,18]]
[[1,4],[4,5]][[1,5]] (touching counts)

Loading the rest of the lesson…