← All problems

Merge Intervals

MediumSorting

Given a list of intervals, merge all overlapping intervals and return the result.

Examples

Input: [[1,3],[2,6],[8,10],[15,18]]
Output: [[1,6],[8,10],[15,18]]

Hints

Solution

Language:
Loading editor…
Output0 lines
Run your code to see output here.
Click Run all tests to check your solution against 5 test cases.