[Python] Check every nums[i] > nums[i+1] and nums[-1] > nums[0].
Approach\n Describe your approach to solving the problem. \nFor every 2 numbers, check nums[i] > nums[i+1] case.\nAlso check nums[-1] > nums[0] case.\n\nIf Ther
# Approach\n<!-- Describe your approach to solving the problem. -->\nFor every 2 numbers, **check nums[i] > nums[i+1]** case.\nAlso **check nums[-1] > nums[0]** case.\n\nIf There is more than 1 case, we can\'t use right shifts to make the nums sorted.\n\nIf there is 1 case, return case position.\n\nIf there is 0 case, no need to sort, return 0.\n\n# Code\n```\nclass Solution(object):\n    def minimumRightShifts(self, nums):\n        drop = 999\n\n        for i in range(len(nums)-1):\n            if nums[i] > nums[i+1]:\n                if drop < 999:\n                    return -1\n                drop = i\n\n        if drop == 999:\n            return 0\n\n        if nums[-1] > nums[0]:\n            if drop < 999:\n                return -1\n            drop = i\n\n        return len(nums) - drop - 1\n```
['Python']