We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2f3ac07 commit 7a485b4Copy full SHA for 7a485b4
09.min.hs
@@ -1,3 +1,3 @@
1
main=interact$(++"\n").show.((,)<$>a<*>a.map reverse).map(map read.words).lines
2
-w z=if all(==0)z then[z]else z:w(zipWith(-)(drop 1$z)z)
3
-a=sum.map(foldr(\u d->last u+d)0.w)
+a=sum.map(sum.map last.w);w=takeWhile(any(/=0)).iterate d
+d z=zipWith(-)(drop 1$z)z
0 commit comments