Employee free time intervals
You are given `schedule`, a list of employees, where each employee is a list of non-overlapping busy intervals [start, end] sorted by start. Return the list of finite COMMON free-time intervals shared by ALL employees, sorted by start, each as [start, end]. Free time before everyone's first meeting and after everyone's last is unbounded and must NOT be included. Flatten all intervals, merge overlaps, and report the gaps. Up to 50 employees, 50 intervals each.
Implement
employee_free_time(schedule: list[list[list[int]]]) → list[list[int]]Examples
in
[[[[1,2],[5,6]],[[1,3]],[[4,10]]]]out[[3,4]]What a strong answer looks like
State your approach and its time/space complexity out loud before you optimize. Handle the edge cases (empty input, duplicates, overflow), and say why you chose this over the brute force. Green tests are the floor, not the grade.
0:00 of about 25 min
solution.py
InputExpectedGot
[[[[1,2],[5,6]],[[1,3]],[[4,10]]]][[3,4]]not run yetsample