Collections: Crossing intervals computed gaps


Combining overlapping intervals in order to compute the missing intervals could be a complex task for advanced programmers. This article presents a new solution based on usage of geometry data type and on a unknown function (if not, maybe less used function) specific designed for geometry objects.

Sample: Give following intervals [1, 5], [64, 70], [66, 72], [150, 200], [130, 300], the question is: what are the missing intervals of numbers? In this sample the merged intervals are [1, 5], [64, 72], [130, 300] and then the missing intervals are [6, 63], [73, 129].

Proposed Solution

To find