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)