"""
Exercise 1: Interval List Intersections (LeetCode 986)

a and b are each sorted lists of pairwise-disjoint closed intervals. Return
their intersection with two pointers: the overlap of a[i] and b[j] is
[max(starts), min(ends)] if non-empty; then advance whichever ends first.
"""

def interval_intersection(a, b):
    # TODO
    return []


# --- self-check: do not modify below this line ---
got = interval_intersection([[0, 2], [5, 10], [13, 23], [24, 25]], [[1, 5], [8, 12], [15, 24], [25, 26]])
want = [[1, 2], [5, 5], [8, 10], [15, 23], [24, 24], [25, 25]]
g2 = interval_intersection([[1, 3], [5, 9]], [])
print(got, g2)
print("PASS" if got == want and g2 == [] else "FAIL")
