class Solution:
def merge(self, intervals: List[List[int]]) -> List[List[int]]:
res = []
intervals.sort()
for i in intervals:
if not res or res[-1][1] < i[0]:
res.append(i)
else:
res[-1][1] = max(i[1],res[-1][1])
return res
0056
最新推荐文章于 2021-04-03 23:32:02 发布