← 返回 amazon 的题目列表Merge Intervals
类型:online_judge
Given a collection of intervals, merge all overlapping intervals.
Input: A list of integer intervals. Each interval is a pair of integers [start, end].
Output: Return the list of intervals sorted in ascending order by their start point after merging any overlapping intervals.
Example Input: [[1,3],[2,6],[8,10],[15,18]]
Example Output: [[1,6],[8,10],[15,18]]
Constraints: Number of intervals n satisfies 1 <= n <= 10000, and the start and end of each interval are in the range of 0 to 10000.
Example
Input
[[1,3],[2,6],[8,10],[15,18]]