diff --git a/day_02/program.py b/day_02/program.py index c726644..a85eb07 100755 --- a/day_02/program.py +++ b/day_02/program.py @@ -20,11 +20,11 @@ def is_safe_single(reports: list) -> bool: decreasing = True for i in range(len(reports) - 1): distance = abs(reports[i] - reports[i + 1]) - if distance < 1 or distance > 3: + if distance == 0 or distance > 3: return False - if reports[i] >= reports[i + 1]: + if reports[i] > reports[i + 1]: increasing = False - if reports[i] <= reports[i + 1]: + if reports[i] < reports[i + 1]: decreasing = False return increasing or decreasing