Python | Video Walkthrough | Time: O(n) | Space: O(1)
Click Here For Video Walkthrough\n\nclass Solution:\n    def minimumRightShifts(self, nums: List[int]) -> int:\n        idx = min(range(len(nums)),key=lambda id
[Click Here For Video Walkthrough](https://youtu.be/zrOr75fEc9Q)\n```\nclass Solution:\n    def minimumRightShifts(self, nums: List[int]) -> int:\n        idx = min(range(len(nums)),key=lambda idx: nums[idx])\n        for i in range(1,len(nums)):\n            if not nums[(idx+i) % len(nums)] >= nums[(idx+i-1) % len(nums)]: return -1\n        return len(nums) - idx if idx != 0 else 0\n```
['Python']