From e5c5b99aee32c602aaf4754770101a86bfb335b0 Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Mon, 2 Dec 2024 10:03:29 +0100 Subject: 2: Fix bug that doesn't get triggered by my input --- 2024/2.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '2024/2.hs') 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] -- cgit v1.2.3-70-g09d2