From: Neil Smith Date: Wed, 1 Dec 2021 21:38:03 +0000 (+0000) Subject: Removed arithmetic X-Git-Url: https://git.njae.me.uk/?a=commitdiff_plain;h=28092a7c519e402030b0b2a40619312d9da87fbd;p=advent-of-code-21.git Removed arithmetic --- diff --git a/advent01/Main.hs b/advent01/Main.hs index 9d62726..a52bf9c 100644 --- a/advent01/Main.hs +++ b/advent01/Main.hs @@ -15,4 +15,5 @@ part2 nums = countIncreasing $ map sum windows where windows = filter ((== 3) . length) $ map (take 3) $ tails nums countIncreasing :: [Int] -> Int -countIncreasing nums = length $ filter (> 0) $ zipWith (-) (tail nums) nums +-- countIncreasing nums = length $ filter (> 0) $ zipWith (-) (tail nums) nums +countIncreasing nums = length $ filter (uncurry (>)) $ zip (tail nums) nums