-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path8.py
More file actions
34 lines (19 loc) · 625 Bytes
/
8.py
File metadata and controls
34 lines (19 loc) · 625 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
def almost_increasing(nums: list[int]) -> bool:
s=0
i = 0
if s <= 1:
return True
else:
return False
def main() -> None:
print("almost_increasing([1,2,5,3,4]) =>",
almost_increasing([1, 2, 5, 1, 6]))
print("almost_increasing([1,2,3,2,1]) =>",
almost_increasing([1, 2, 3, 2, 1]))
print("almost_increasing([1,2,3,4]) =>",
almost_increasing([1, 2, 3, 4]))
assert almost_increasing([1, 2, 5, 3, 4]) is True
assert almost_increasing([1, 2, 3, 2, 1]) is False
assert almost_increasing([1, 2, 3, 4]) is True
if __name__ == "__main__":
main()