← 返回 nvidia 的题目列表Merge Overlapping Intervals in Array
类型:online_judge
nvidia
Given an array of time intervals where each interval is represented as a pair of integers that denotes start and end times, your task is to merge all overlapping intervals and return the list of merged intervals. For example, given the input [[1,3],[2,6],[8,10],[15,18]], the output should be [[1,6],[8,10],[15,18]].
Implement a Python function to achieve this with optimal time complexity.
Example
Input
[[1,3],[2,6],[8,10],[15,18]]