diff options
author | Tom Smeding <tom@tomsmeding.com> | 2024-12-02 10:03:29 +0100 |
---|---|---|
committer | Tom Smeding <tom@tomsmeding.com> | 2024-12-02 10:03:29 +0100 |
commit | e5c5b99aee32c602aaf4754770101a86bfb335b0 (patch) | |
tree | 3151d8455d380cf4290c88aee2ee43dbd39e716e /2024 | |
parent | ff973cbb34f03be0c570a4d16aaf8c173d1e7c7e (diff) |
2: Fix bug that doesn't get triggered by my input
Diffstat (limited to '2024')
-rw-r--r-- | 2024/2.hs | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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] |