Day 2: 240
This commit is contained in:
parent
536dd4f89e
commit
8984d1060c
1 changed files with 3 additions and 0 deletions
3
d2golf.hs
Normal file
3
d2golf.hs
Normal file
|
@ -0,0 +1,3 @@
|
|||
q[h,f](d,n)|"u"<-d=[h-n,f]|"d"<-d=[h+n,f]|let=[h,f+n]
|
||||
p[h,f,a](d,n)|"u"<-d=[h,f,a-n]|"d"<-d=[h,f,a+n]|let=[h+n,f+n*a,a]
|
||||
main=interact$show.(\a->product.($a)<$>[init.foldl p[0,0,0],foldl q[0,0]]).map(fmap read.splitAt 1.map head.words).lines
|
Loading…
Add table
Reference in a new issue