Check if Array Is Sorted and Rotated | Leetcode 1752