I would love to see a elegant array based solution
this problem -- cough, @Bubbler. It seems almost impossible to avoid doing disguised procedural programming using
$:
or
^:
or a reduction
/
-- all solutions end up requiring local mutating vars. The phrase
+/\\.
results an intriguing matrix with a simpler solution algorithm on it, but it still ends up being too cumbersome. Hoping I've missed somthing...