APL Question: Trying to write an APL solution for "Longest Valid Parentheses". I have gotten to this:
t ← '}{}{{}}}}{}'
+\(~,[0.5]⊢)'{'=t
1 1 2 2 2 3 4 5 6 6 7
0 1 1 2 3 3 3 3 3 4 4
And now I need to reset the "plus scans" any time row 1 is greater than row 2. Is there an easy way to do that?