Day 3Part1: not Optimized

This commit is contained in:
Christoph Stahl 2021-12-03 10:13:54 +01:00
parent f75b36b26b
commit 56fc98f387

8
d3golf.hs Normal file
View file

@ -0,0 +1,8 @@
import Data.List
d=id
v p@(x:s)=(length p,length x,p)
q l z = fromEnum$l`div`2<z
c=foldr(\x y->2*y+x)0.reverse
u w i=i*(2^w-1-i)
t (h,w,i)=u w$c$map(q h.sum.map(subtract 48.fromEnum))$transpose i
main=interact$show.((,).d<*>d).t.v.lines