Generally, how can you determine how to iterate through an array based on a known pattern?
Specifically, this is the pattern I would like to iterate through, returning an array of arrays: (Each digit is an index value of the original array: [0, 1, 2, 3])
0
0,1
0,1,2
0,1,2,3
1
1,2
1,2,3
2
2,3
3
Here’s another more concise alternative: