
Solution) class Solution: def merge(self, intervals: List[List[int]]) -> List[List[int]]: # Initialization intervals.sort() res = [intervals[0]] for start, end in intervals[1:]: lastEnd = res[-1][1] # If the current interval overlaps the previous interval if start List[List[int]]: intervals.sort() res = [intervals[0]] for start, end in intervals[1:]: lastEnd = res[-1][1] if start