Bloomberg | Non Overlapping Intervals

Anonymous User
1587
Oct 10, 2022

Given a collection of intervals, return a maximal set of non-overlapping intervals while prioritising the longer intervals.

input - (1,5),(2,7),(11,18)
output - (11, 18), (2, 7)

Any ideas?

Comments (7)