Back to problems

Intersection of Two Interval Lists

Algorithm · ByteDance · Medium

Intersection of Two Interval Lists Medium · Topics: Two Pointers, Arrays · Company Tags: Facebook, Amazon, Uber · Hints: Use two pointers to scan both lists; track the later of the two starts and the earlier of the two ends; advance the pointer whose current interval finishes earlier. Given two lists of closed intervals, where each list is internally disjoint (no two intervals in the same list overlap) and sorted in ascending order by start value, compute the list of…

Checking your access…