I am looking for a solution (preferably JavaScript) that would find gaps in a select set of child ranges compared to their parent range.
Example 1: If I select a parent range of {1,10} and child ranges of {1,2} and {2,10} I would have a gap of 0, meaning the range in the parent range has been completely filled by it’s children.
Example 2: If I select a parent range of {1,10} and child ranges of {1-3} and {6,8} I would have a gap of 4.
The resulting total is the number of missing numbers, assuming you’re only using integers.