The Question
CodingMerge Overlapping Intervals
Given a collection of time intervals, consolidate all overlapping or adjacent ranges into a single continuous interval. The goal is to produce a simplified set of disjoint intervals that covers the same total span as the original input. Provide an implementation that handles unsorted input efficiently and accounts for varying interval lengths.
Java
Sort + Linear Scan
2D Array
February 16, 2026