A PERFECT SOLUTION WITH DEQUE
\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# Code\n```\nclass Solution:\n    def minimumRightShifts(self, nums: List[int]) -> int:\n        s = sorted(nums)\n        if s == nums :\n            return 0\n        d = deque(nums)\n        c = 0\n        l = len(nums)\n        while list(d) != s :\n            d.rotate(1)\n            c += 1\n            if c == l :\n                return -1\n        return c\n        \n```\n## PLS>
['Array', 'Python3']