Interval List Intersections
Explore how to identify the intersection of two sorted, disjoint interval lists. This lesson helps you understand the method to find overlapping intervals using start and end times, preparing you to solve similar coding interview problems involving interval operations and time complexity trade-offs.
We'll cover the following...
Statement
Given two lists of interval_list_a and interval_list_b, return the intersection of the two interval lists.
Each interval in the lists has its own start and end time and is represented as [start, end]. Specifically:
interval_list_a[i] = [starti, endi]interval_list_b[j] = [startj, endj]
The intersection of two closed intervals i and j is either:
An empty set, if they do not overlap, or
A closed interval
[max(starti, startj), min(endi, endj)]if they do overlap.
Also, each list of intervals is pairwise disjoint and in sorted order.
Constraints:
...