projects
/
advent-of-code-21.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a2a16b8
)
Removed arithmetic
author
Neil Smith
<neil.git@njae.me.uk>
Wed, 1 Dec 2021 21:38:03 +0000
(21:38 +0000)
committer
Neil Smith
<neil.git@njae.me.uk>
Wed, 1 Dec 2021 21:38:03 +0000
(21:38 +0000)
advent01/Main.hs
patch
|
blob
|
history
diff --git
a/advent01/Main.hs
b/advent01/Main.hs
index 9d627260e2887769b4e74d8f7546fcc94bac9b25..a52bf9c1a6bd597c69118aab6f859eb5eb1cb3af 100644
(file)
--- 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