Category: merge_intervals
-
LeetCode 621: Task Scheduler
link Note len(tasks)is the lower bound for interval count. If all tasks are distinct, scheduling them in any order achieves the lower bound. However, when some tasks are repeated, we may need to insert idle cycles to cool the CPU down. With repeated tasks, if possible, we should put two instances of the same task…
-
LeetCode 253: Meeting Rooms II
link We schedule meetings in order of their start times. If there is a free room, we use it or we declare a new room is required. Say we are trying to schedule the -th meeting and currently there are meeting rooms with earlier meetings scheduled. Which among these rooms would be the most likely…
-
LeetCode 759: Employee Free Time
link Pre-sort A single employee’s free times are the gaps between consecutive work intervals. For more than one employees, we can merge overlapping work intervals and have a list of disjoint work intervals across all employees. Then, free times once again would be the gaps between consecutive work intervals. Say there are employees and the…