Fix 2024 day 2.
This commit is contained in:
parent
82452c0751
commit
a4ad0259a9
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user