summaryrefslogtreecommitdiff
path: root/2024
diff options
context:
space:
mode:
authorTom Smeding <tom@tomsmeding.com>2024-12-02 10:03:29 +0100
committerTom Smeding <tom@tomsmeding.com>2024-12-02 10:03:29 +0100
commite5c5b99aee32c602aaf4754770101a86bfb335b0 (patch)
tree3151d8455d380cf4290c88aee2ee43dbd39e716e /2024
parentff973cbb34f03be0c570a4d16aaf8c173d1e7c7e (diff)
2: Fix bug that doesn't get triggered by my input
Diffstat (limited to '2024')
-rw-r--r--2024/2.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/2024/2.hs b/2024/2.hs
index e29acec..26065ff 100644
--- a/2024/2.hs
+++ b/2024/2.hs
@@ -7,6 +7,6 @@ main = do
let safeRep l = all (uncurry safePair) (zip l (tail l)) ||
all (uncurry (flip safePair)) (zip l (tail l))
print $ sum [fromEnum (safeRep l) | l <- input]
- let dampened l = zipWith (++) (inits l) (tail (tails l))
+ let dampened l = l : zipWith (++) (inits l) (tail (tails l))
let safeRep' l = any safeRep (dampened l)
print $ sum [fromEnum (safeRep' l) | l <- input]