Example 1:
Input: schedule = [[[1,2],[5,6]],[[1,3]],[[4,10]]]
Output: [[3,4]]
Explanation:...Example 2:
Input: schedule = [[[1,3],[6,7]],[[2,4]],[[2,5],[9,12]]]
Output: [[5,6],[7,9]]
(Even...思路:
大致题意是求所有区间的并集的补集。...先根据区间的start排序,假设当前区间为now,那么如果新来的区间start在now区间表示的范围内,说明两个区间存在交集,更新右边界,直到不存在交集时,能够求得第一个补集,依此类推。...Java版本:
class P implements Comparable{
int start;
int end;
P(int start