Day 6: 119

This commit is contained in:
Christoph Stahl 2021-12-06 17:19:27 +01:00
parent 1f5b481b6a
commit a01803af67

View file

@ -1,3 +1,3 @@
j=(1<$[0..8])<>zipWith(+)j(drop 2 j)
d n=sum.map(\i->j!!((8-i)+n))
main=interact$show.((,).d 256<*>d 80).read.('[':).(++"]")
j=(1<$[0..8])++zipWith(+)j(drop 2 j)
d x n=sum[j!!(8-i+n)|i<-x]
main=interact$show.(<$>[256,80]).d.read.('[':).(++"]")