From 540fe37b9ddafeef971277fe1aa4fd70f96d6321 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mika=C3=ABl=20Capelle?= Date: Mon, 2 Dec 2024 18:44:50 +0100 Subject: [PATCH] Fix 2024 day 2. --- src/holt59/aoc/2024/day2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/holt59/aoc/2024/day2.py b/src/holt59/aoc/2024/day2.py index 64ccf46..1425d49 100644 --- a/src/holt59/aoc/2024/day2.py +++ b/src/holt59/aoc/2024/day2.py @@ -13,7 +13,7 @@ def is_any_safe(level: list[int]) -> bool: return any(is_safe(level[:i] + level[i + 1 :]) for i in range(0, len(level))) -levels = [[int(c) for c in r.split()] for r in sys.stdin.read().splitlines()] +levels = [[int(c) for c in r.split()] for r in sys.stdin.read().strip().splitlines()] answer_1 = sum(is_safe(level) for level in levels) answer_2 = sum(is_safe(level) or is_any_safe(level) for level in levels)