01 · Question
You are given two lists of closed intervals, firstList and secondList, where firstList[i] = [start_i, end_i] and secondList[j] = [start_j, end_j]. Each list of intervals is pairwise disjoint and in sorted order.
Return the intersection of these two interval lists.
Example 1:
- Input:
firstList = [[0,2],[5,10], [13,23], [24,25]],secondList = [[1,5],[8,12], [15,24], [25,26]] - Output:
[[1,2],[5,5],[8,10],[15,23],[24,24],[25,25]]