1752. Check if Array Is Sorted and Rotated

Updated: 2024-03-12
1 min read
[]

On This Page

LeetCode problem 1752

class Solution:
    def check(self, nums: List[int]) -> bool:
        return sum(nums[i - 1] > v for i, v in enumerate(nums)) <= 1