Check If Array Is Sorted And Rotated Leetcode Solution