Back to problems

Merge Two Interval Lists

Algorithm · Meta · Medium

This task is a variation of the interval-merging problem. You are given two interval lists. Each interval is a two-element array in the form [start, end], and each list is sorted by interval start time without overlaps within that list. Your goal is to combine the lists into one collection of non-overlapping intervals. Whenever intervals belonging to the two different lists overlap, replace them with one interval covering their full continuous span. Constraints Each list is…

Checking your access…