I have an matrix (array of arrays) in the form
[1, 2, 3, 4]
[12, 23, 34]
[123, 234]
[1234]
And want to produce sequences of this matrix that is following each other and is (converted to a string) in the same length as the array at index 0 (top-most). So i.e. the result of this would be
[1, 2, 3, 4]
[12, 3, 4]
[1, 23, 4]
[1, 2, 34]
[12, 34]
[123, 4]
[1, 234]
[1234]
The thing I want to achive is to get all parts of a string that can be directly connected to each other and splitted i sub arrays (as shown in the example).
The implementation language is irrelevant but preferably in i.e. Python, java, ruby, C#, clojure, Psudo code, or other language at a fairly high level.
I improved the code from my previous one.
will give you: