Day 3Part1: not Optimized
This commit is contained in:
parent
f75b36b26b
commit
56fc98f387
1 changed files with 8 additions and 0 deletions
8
d3golf.hs
Normal file
8
d3golf.hs
Normal 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
|
Loading…
Add table
Reference in a new issue