about summary refs log tree commit diff
path: root/day10.k
blob: 0b86ba87c1e5b6485639ceaf4f31a7b314a96f6f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
d:"1113122113"

/ r:{o:(x=*x)?0;:[o=#x;,x;(,(o#x)),_f[o _ x]]}
r:{(0,1+&~=':x) _ x} / group consecutive elements

l:{,/ {($#x),*x}' r x} / look-and-say, 1 step

s:(40 l/d)

v: #s

s:(10 l/s) / 10 more steps
/ for some reason this takes ages...

v: #s