Merge Overlapping Intervals

Given a collection of intervals, merge all overlapping intervals.

For example:

Given [1,3],[2,6],[8,10],[15,18],

return [1,6],[8,10],[15,18].

Make sure the returned intervals are sorted.

Interview Code Editor
Hints
  • Solution Approach
  • Complete Solution
6164 successful submissions.
Asked In:
  • Google
Click here to jump start your coding interview preparation