Skip to content

Commit 78a622a

Browse files
committed
dialy
1 parent 69b78f1 commit 78a622a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

my-submissions/e1752.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
class Solution:
2+
def check(self, nums: List[int]) -> bool:
3+
allowance_used = False
4+
for i, j in zip(nums[:-1], nums[1:]) :
5+
if i <= j :
6+
continue
7+
if allowance_used :
8+
return False
9+
allowance_used = True
10+
return not allowance_used or (nums[0] >= nums[-1])

0 commit comments

Comments
 (0)