README ¶ 56. Merge 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]. 解题思路 先对 intervals 进行排序,按照 Start 递增 依次处理重叠的情况。 附注 最快的答案和我的思路一样,只是使用的是 merge sort ,自我感觉我的答案更清晰,就没有改成他的。 Expand ▾ Collapse ▴ Documentation ¶ Index ¶ type Interval Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ This section is empty. Types ¶ type Interval ¶ type Interval struct { Start int End int } Interval Definition for an interval. Source Files ¶ View all Source files merge-intervals.go Click to show internal directories. Click to hide internal directories.