Solution: Employee Free Time
Explore how to identify common free time for multiple employees by merging their non-overlapping intervals. Learn to use min-heaps to process schedule intervals efficiently and detect gaps representing free time. Understand the step-by-step algorithm to combine intervals, evaluate timing overlaps, and derive free slots between meetings.
We'll cover the following...
Statement
You’re given a list containing the schedules of multiple employees. Each person’s schedule is a list of non-overlapping intervals in a sorted order. An interval is specified with the start and end time, both being positive integers. Your task is to find the list of finite intervals representing the free time for all the employees.
Note: The common free intervals are calculated between the earliest start time and the latest end time of all meetings across all employees.
Constraints:
-
schedule.length,schedule[i].length -
interval.start<interval.end...