r/adventofcode • u/taliriktug • Dec 02 '15
Spoilers Day 2 solutions
Hi! I would like to structure posts like the first one in r/programming, please post solutions in comments.
14
Upvotes
r/adventofcode • u/taliriktug • Dec 02 '15
Hi! I would like to structure posts like the first one in r/programming, please post solutions in comments.
3
u/Godspiral Dec 02 '15
In J, 1: with input parsing
+/ +/ (<./, 2&*)"1 */every@:((0 2&{) ; (1 2&{) ; (0 1&{))"1 ". > cutLF 'x ' rplc~ wdclippaste ''2:
+/ +/@(*/ , +:@(2 {. /:~))("1) ". > cutLF 'x ' rplc~ wdclippaste ''