about summary refs log tree commit diff
path: root/day04.k
blob: f2ef8f6ad7e7566b6e38c8100803de0893a1b674 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
n:{.:x@&~(x<"0")|x>"9"}

+/n'm:{(1_-6#-1_x)~5#!=v@>{(+/x=*x),-*x}'v,\:v:-7_x^"-01234567890"}#0:"day04"
/ 361724

/ thanks to John Earnest
+/n'm:{(1_-6#-1_x)~5#>#:'=v@<v:-7_x^"-01234567890"}#0:"day04"

n@*{"north"~5#`c$"a"+26!(n@x)+x-"a"}#m
/ 482