I need to generate all subarrays from a single array. I need it in a specific order though. So for example, if the array is:
[1,2,3,4]
I should be