From 63c1f74fe9a20984f6a19c3c2344793b1ed10072 Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Fri, 17 Dec 2021 13:25:23 +0200 Subject: Day 17 --- day16/main.hs | 4 ---- 1 file changed, 4 deletions(-) (limited to 'day16') diff --git a/day16/main.hs b/day16/main.hs index 76b3db1..56510ae 100644 --- a/day16/main.hs +++ b/day16/main.hs @@ -39,10 +39,6 @@ binaryToInt = reverse .> binaryToInt' binaryToInt' [] = 0 binaryToInt' (x : xs) = digitToInt x + 2 * binaryToInt' xs -takeUntil :: (a -> Bool) -> [a] -> [a] -takeUntil _ [] = [] -takeUntil p (x : xs) = x : if p x then takeUntil p xs else [] - applyOperator opTypeId subValues = case opTypeId of 0 -> sum subValues 1 -> product subValues -- cgit v1.3