BQN

Figure out the number of columns

2โ€ฟโˆ˜โฅŠ๐•ฉ

Get all subarrays

{โˆพ(<ห˜โ†•โŸœ๐•ฉ)ยจ1+โ†•โ‰ ๐•ฉ}