more cleanups
This commit is contained in:
parent
d8bd434c0f
commit
107af855b4
1 changed files with 3 additions and 3 deletions
|
|
@ -20,11 +20,11 @@ def is_safe_single(reports: list) -> bool:
|
||||||
decreasing = True
|
decreasing = True
|
||||||
for i in range(len(reports) - 1):
|
for i in range(len(reports) - 1):
|
||||||
distance = abs(reports[i] - reports[i + 1])
|
distance = abs(reports[i] - reports[i + 1])
|
||||||
if distance < 1 or distance > 3:
|
if distance == 0 or distance > 3:
|
||||||
return False
|
return False
|
||||||
if reports[i] >= reports[i + 1]:
|
if reports[i] > reports[i + 1]:
|
||||||
increasing = False
|
increasing = False
|
||||||
if reports[i] <= reports[i + 1]:
|
if reports[i] < reports[i + 1]:
|
||||||
decreasing = False
|
decreasing = False
|
||||||
return increasing or decreasing
|
return increasing or decreasing
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue