https://leetcode.com/problems/merge-intervals/
It means each list in intervals is a range, just to merge the overlapping one, others stay the same.
解題:
- sort
sort by the start of each range
save the first one in result
if any the start of each range smaller then the last item in result, it should be merged, otherwise append in result
1 | class Solution(object): |