X-Git-Url: https://git.njae.me.uk/?a=blobdiff_plain;f=advent01%2FMain.hs;h=a52bf9c1a6bd597c69118aab6f859eb5eb1cb3af;hb=28092a7c519e402030b0b2a40619312d9da87fbd;hp=9d627260e2887769b4e74d8f7546fcc94bac9b25;hpb=a2a16b80400775f291b74d4923a00949fb1b70f1;p=advent-of-code-21.git 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