i keep thinking about this algorithm, i found one way to do it but it feels pretty ineffecient, curious of other people have ideas :)
say you have an input array like `1 4 5 6 9 13 17 18 100 101 104`, you can assume all elements are positive and the array is monotonically increasing
the result you want is an array of arrays, of all subsequences where the next number is n+1, so for the above example you would want (1) (4 5 6) (9) (13) (17 18) (100 101) (104)
say you have an input array like `1 4 5 6 9 13 17 18 100 101 104`, you can assume all elements are positive and the array is monotonically increasing
the result you want is an array of arrays, of all subsequences where the next number is n+1, so for the above example you would want (1) (4 5 6) (9) (13) (17 18) (100 101) (104)