Collections: Computed gaps for continuous numbers


Problem

Finding the hole for continuous sequences of numbers could be a discouraging task even 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: Given the following sequence of [dis]continuous numbers 1, 2, 7, 8, 9, 10, 30 how to compute the missing intervals [3, 6], [11, 29] ?

Proposed Solution

The first step in combining these integers into ranges suppose the transformation of every integer into range [Integer-1, Integer] and then into a spatial