aboutsummaryrefslogtreecommitdiff
path: root/execs/Day10.hs
diff options
context:
space:
mode:
authorAkshay <[email protected]>2020-12-11 10:19:03 +0000
committerAkshay <[email protected]>2020-12-11 10:19:03 +0000
commit42523f2455fb30181efc29e3a47799283b05fa80 (patch)
treece0687d20a0813cd8bcb2ccc46ff16a2db8b7251 /execs/Day10.hs
parentedd8e1fa47c6895b28bbe61ab786ab6dc30471cd (diff)
add initial solution to day11
Diffstat (limited to 'execs/Day10.hs')
-rw-r--r--execs/Day10.hs4
1 files changed, 1 insertions, 3 deletions
diff --git a/execs/Day10.hs b/execs/Day10.hs
index c42a550..40d3d61 100644
--- a/execs/Day10.hs
+++ b/execs/Day10.hs
@@ -16,9 +16,7 @@ diffs s = product $ ($ q s) <$> [howMany (==1), howMany (==3)]
16combos top s = startEvalMemo $ go 0 16combos top s = startEvalMemo $ go 0
17 where go c 17 where go c
18 | c == top = return 1 18 | c == top = return 1
19 | otherwise = do 19 | otherwise = sum <$> mapM (memo go) (filter (`elem` s) $ map (+c) [1,2,3])
20 let cs = filter (`elem` s) $ map (+c) [1,2,3]
21 sum <$> mapM (memo go) cs
22 20
23main :: IO () 21main :: IO ()
24main = do 22main = do