From 94de56b7b8839ce6a5b00ad33f760ba0fc50f7ad Mon Sep 17 00:00:00 2001 From: Christoph Stahl Date: Fri, 10 Dec 2021 20:59:17 +0100 Subject: [PATCH] Day 10: 290 --- d10golf.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/d10golf.hs b/d10golf.hs index 2ee640d..4ae3e82 100644 --- a/d10golf.hs +++ b/d10golf.hs @@ -2,7 +2,7 @@ import Data.List e=fromEnum n%(h:t)|h`elem`"([{<"=(h:n)%t|i:s<-n,abs(e h-e i)<3=s%t|let=(0,a[h]) n%_=(foldl((+).(5*))0$b<$>n,0) -a")"=3;a"]"=57;a"}"=1197;a">"=25137 +a")"=3;a"]"=57;a"}"=1197;a _=25137 b '('=1;b '['=2;b '{'=3;b _=4 c(x,y)=((!!)<*>(`div`2).length$filter(>0)$sort x,sum y) main=interact$show.c.unzip.map(""%).lines \ No newline at end of file