Compare commits
3 commits
b5425025a6
...
08aab425a2
Author | SHA1 | Date | |
---|---|---|---|
Bruno BELANYI | 08aab425a2 | ||
Bruno BELANYI | 66c9d92749 | ||
Bruno BELANYI | 6634348afe |
|
@ -13,8 +13,6 @@ def solve(input: list[str]) -> int:
|
||||||
def is_safe(report: Report) -> bool:
|
def is_safe(report: Report) -> bool:
|
||||||
def is_increasing_safe(report: Report):
|
def is_increasing_safe(report: Report):
|
||||||
for a, b in itertools.pairwise(report):
|
for a, b in itertools.pairwise(report):
|
||||||
if a >= b:
|
|
||||||
return False
|
|
||||||
if not 1 <= (b - a) <= 3:
|
if not 1 <= (b - a) <= 3:
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
|
@ -13,8 +13,6 @@ def solve(input: list[str]) -> int:
|
||||||
def is_safe(report: Report) -> bool:
|
def is_safe(report: Report) -> bool:
|
||||||
def is_increasing_safe(report: Report):
|
def is_increasing_safe(report: Report):
|
||||||
for a, b in itertools.pairwise(report):
|
for a, b in itertools.pairwise(report):
|
||||||
if a >= b:
|
|
||||||
return False
|
|
||||||
if not 1 <= (b - a) <= 3:
|
if not 1 <= (b - a) <= 3:
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
Loading…
Reference in a new issue