You are given schedule, a list where each element contains the working hours of one employee.
Each employee’s working hours are represented as a list of Interval objects that are already sorted and do not overlap.
Return all finite intervals with non-zero duration during which all employees are simultaneously free. The resulting list of free intervals should also be sorted in ascending order.
Note: The intervals are represented as objects, not arrays. For example,
schedule[0][0].start = 1andschedule[0][0].end = 2, whileschedule[0][0][0]is invalid. Do not include intervals with zero length (for example,[3, 3]) in the output.
Constraints:
schedule.length , schedule[i].length
interval.start < interval.end , where interval is any interval in the list of schedules.
You are given schedule, a list where each element contains the working hours of one employee.
Each employee’s working hours are represented as a list of Interval objects that are already sorted and do not overlap.
Return all finite intervals with non-zero duration during which all employees are simultaneously free. The resulting list of free intervals should also be sorted in ascending order.
Note: The intervals are represented as objects, not arrays. For example,
schedule[0][0].start = 1andschedule[0][0].end = 2, whileschedule[0][0][0]is invalid. Do not include intervals with zero length (for example,[3, 3]) in the output.
Constraints:
schedule.length , schedule[i].length
interval.start < interval.end , where interval is any interval in the list of schedules.