← Questions

Merge intervals: combine every overlapping range

0
AmazonAppleMeta+4CodingLast asked Sep 2026

Given a list of closed integer intervals start, end with start <= end, merge every group of overlapping intervals into one and return the merged intervals sorted by start. Two closed intervals overlap when they share at least one point, so…

Sign in to unlock this question

The full prompt, the worked answer and your own canvas or code with the AI tutor. New accounts get 3 credits: each one unlocks a question for good.

Your code and the AI tutor open when you unlock this question.