Space
Open
From Fieldwork
Scales
Archive
Allow one
class Solution:
def check(self, nums):
n = len(nums)
if n <= 2:
return True
drops = 0
for i in range(n):
if nums[i] > nums[(i + 1) % n]: # Wrap-around comparison
drops += 1
if drops > 1:
return False
return TruePractice bench
A private scratchpad for this reading. Nothing is sent or scored.
What is still unclear, or what would change the explanation?
Saved on this device · one draft per mode