1752. Check if Array Is Sorted and Rotated

Обновлено: 2024-03-12
1 мин
[]

Содержание

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