Algorithm · Nuro · Medium
You are given a list intervals of inclusive integer intervals. Each interval is a pair [start, end] with start <= end, and it covers every integer x satisfying start <= x <= end. The intervals may be unsorted and may overlap. Because the number line is discrete, adjacent intervals such as [1,3] and [4,6] are treated as one continuous covered range, since there is no missing integer between them. Consider the union of all integers covered by any interval. Let L be the…
Checking your access…