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?