From f009aff1eb64e04b25a388acf7c14c265a115d37 Mon Sep 17 00:00:00 2001 From: Christoph Stahl Date: Thu, 2 Dec 2021 17:34:04 +0100 Subject: [PATCH] Day 2: 233 --- d2golf.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/d2golf.hs b/d2golf.hs index abaaee3..00b25e4 100644 --- a/d2golf.hs +++ b/d2golf.hs @@ -1,3 +1,3 @@ q(h:f:_)(d,n)|"f"d=[h+n,f]|let=[h,f+n] p[h,f,a](d,n)|"f"d=[h,f,a+n]|let=[h+n,f+n*a,a] -main=interact$show.(<$>[p,q]).((product.take 2).).flip(`foldl`[0,0,0]).map(fmap read.splitAt 1.map head.words).lines \ No newline at end of file +main=interact$show.(<$>[p,q]).((\(a:b:_)->a*b).).flip(`foldl`[0,0,0]).map(fmap read.splitAt 1.map head.words).lines \ No newline at end of file