From 28092a7c519e402030b0b2a40619312d9da87fbd Mon Sep 17 00:00:00 2001 From: Neil Smith Date: Wed, 1 Dec 2021 21:38:03 +0000 Subject: [PATCH] Removed arithmetic --- advent01/Main.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 -- 2.34.1