Merge Intervals (Greedy)
Learn Merge Intervals (Greedy) (Greedy Algorithms, Data Structures & Algorithms) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.
Employee Free Time - Merging Across Multiple Schedules A harder variant of basic interval merging: given several employees' individual busy schedules (each already sorted and non-overlapping WITHIN a person), find the COMMON free time slots shared by everyone. The greedy approach: flatten ALL intervals together, sort by start, merge overlapping busy periods exactly like basic merge intervals - then the GAPS between merged intervals are the shared free time.