Assuming I have an array N ← 0 0 0 1 1 1 0 0 1, how can I apply the scan \ to achieve the array 0 0 0 1 2 3 0 0 1?
+\N gives me 0 0 0 1 2 3 3 3 4 which is not what I want.
+\¨⊆⍨N gives me | 1 2 3 | 1 | which is closer, but then I lose the positions.
Is there a way to carry the original values in the scan and multiply, or perhaps a better way?