toRangedPairs

Ex: toRangedPairs([3,4,5,5,6,6,10,25,26]) == [[3,6], [10,10], [25,26]] Only intended for integer types and other ordered types for which "x+1" makes sense. Input does not have to be sorted. The resulting pairs are sorted and are inclusive on both ends. Optionally takes a splitCond predicate so you can customize when the range ends.

T[2][]
toRangedPairs
(
alias splitCond = "b > a + 1"
T
)
(
T[] arr
)

Meta