Python beats 90%
Code\n\nclass Solution:\n    def minimumRightShifts(self, nums: List[int]) -> int:\n        s = sorted(nums)\n        if s == nums:\n            return 0\n\n   
# Code\n```\nclass Solution:\n    def minimumRightShifts(self, nums: List[int]) -> int:\n        s = sorted(nums)\n        if s == nums:\n            return 0\n\n        for i in range(len(nums)):\n            nums = nums[-1:]+nums[:-1]\n            if nums == s: \n                return i+1\n        return -1\n```
['Python3']