結果 : check if array is sorted and rotated leetcode solution python