Merge Time Intervals From Multiple Detectors

Asked at Amazon · Coding Questions · Difficulty: Easy · Last asked Nov 11, 2026

You are given a list of closed time intervals `[l, r]` produced by multiple detectors. Merge them into a list of non-overlapping intervals sorted by start. Intervals that only touch at an endpoint (e.g. `[15,18]` and `[18,20]`) should be merged.

Loading the problem…