Solving LeetCode 1752 Check if Array Is Sorted and Rotated in Python.
Trick: a sorted and rotated array has at most one position where an element is greater than the next element in circular order. Count those violations and you are done.
Problem link:
https://leetcode.com/problems/check-if-arr...