Free time shared by everyone
Each person's calendar is a list of busy blocks [start, end] with start < end, sorted by start, and no two blocks of the same person overlap. Given schedules, one calendar per person, return the gaps [start, end] of positive length in which nobody is busy, sorted by start. Count only gaps between busy blocks: the open time before the first block and after the last one is not a gap. Blocks that meet at a point, like [1, 3] and [3, 5], leave no gap, even across people.
schedules may be empty, and so may any calendar. Make use of each calendar being sorted already.
Besides the tests, one large input (60 calendars, 3,000 blocks) with a ~150 ms limit (scaled to your device's speed): brute force won't pass.
Examples
shared_free_time([[[1,3],[6,7]],[[2,4]],[[2,5],[9,12]]])→[[5,6],[7,9]]shared_free_time([[[1,2],[5,6]],[[1,3]],[[4,10]]])→[[3,4]]shared_free_time([[[1,3]],[[3,5]]])→[]