Day 12: 282

This commit is contained in:
Christoph Stahl 2021-12-14 02:43:07 +01:00
parent c8a1a9cdde
commit 67e38fc1c3

8
d12golf.hs Normal file
View file

@ -0,0 +1,8 @@
import Data.List
z=filter
s="start"
w(a,b)=(b,a)
i%m=map snd$z((==i).fst)(m++map w m)
g c v f m|c=="end"=[[]]|let=map(c:)$(\x->g x(z(>"Z")$c:v)f m++[q|f,q<-g x v(2<1)m])=<<c%m\\v
v t=length.group.sort.g s[s]t
main=interact$show.((,).v(2>1)<*>v(2<1)).map(fmap tail.span(/='-')).lines