Merge Intervals

Problem Overview

  • Merge overlapping intervals in an array and return a list of non-overlapping ranges that cover all input.
  • Input: intervals[i] = [start, end]; Output: merged intervals; Constraints: 1–10^4 items, 0 ≤ start ≤ end ≤ 10^4.
  • Real-world context: consolidating time slots or ranges in scheduling, booking, or timeline data.
  • This problem from Amazon interviews is a classic coding interview and interview question.

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Input Variables
Execution Result: