package
0.0.0-20241220224003-b7cf03a90b2b
Repository: https://github.com/szhou12/leetcode-go.git
Documentation: pkg.go.dev

# README

56. Merge Intervals

Solution idea

Greedy Algorithm

Key 1: 按照start time从小到大排序

Key 2: i-th end time 比较 (i+1)-th start time找重叠,merge时选择较大一个的 end time

Time complexity = $O(n\log n)$

注意!!! 这道题和find largest compatible subset 不一样,那道题sort end time, 这道题sort start time