Sweep-Line
LeetCode 253: Meeting Rooms II
·2 mins
LeetCode
Medium
Heap
Sorting
Intervals
Sweep-Line
LeetCode 253 note: a heap of end times for running meetings; half-open intervals need <=
LeetCode 759: Employee Free Time
·2 mins
LeetCode
Hard
Heap
K-Way-Merge
Intervals
Sweep-Line
LeetCode 759 note: k-way merge all work intervals by start; any gap after the latest end so far is common free time
LeetCode 986: Interval List Intersections
·2 mins
LeetCode
Medium
Two-Pointers
Sweep-Line
Array
LeetCode 986 note: two pointers each hold an interval, the intersection is [max(starts), min(ends)], and the interval that ends first cannot meet anything else, so its pointer advances