[ Python ] ✅✅ Simple Python Solution | 100% Faster🥳✌👍
If You like the Solution, Don\'t Forget To UpVote Me, Please UpVote! \uD83D\uDD3C\uD83D\uDE4F\n# Runtime: 47 ms, faster than 100.00% of Python3 online submissio
# If You like the Solution, Don\'t Forget To UpVote Me, Please UpVote! \uD83D\uDD3C\uD83D\uDE4F\n# Runtime: 47 ms, faster than 100.00% of Python3 online submissions for Minimum Right Shifts to Sort the Array.\n# Memory Usage: 16.1 MB, less than 100.00% of Python3 online submissions for Minimum Right Shifts to Sort the Array.\n\n![image](https://assets.leetcode.com/users/images/fa2427ed-3bc1-423f-afaf-7f575e0e72a9_1695039319.2828484.png)\n\n\tclass Solution:\n\t\tdef minimumRightShifts(self, nums: List[int]) -> int:\n\n\t\t\tsorted_nums = sorted(nums)\n\n\t\t\tresult = 0\n\n\t\t\twhile result < len(nums):\n\n\t\t\t\tif nums == sorted_nums:\n\t\t\t\t\treturn result\n\n\t\t\t\tresult = result + 1\n\n\t\t\t\tlast_element = nums.pop()\n\n\t\t\t\tnums.insert(0, last_element)\n\n\t\t\treturn -1\n\n\tTime Complexity : O(N*log(N))\n\tSpace Complexity : O(1)\n# Thank You \uD83E\uDD73\u270C\uD83D\uDC4D
['Sorting', 'Python', 'Python3']