C++, very easy to understand
class Solution {\npublic:\n    int minimumRightShifts(vector& nums) {\n        \n        int n = nums.size();\n        int i;\n        vectorv = nums;\n        
class Solution {\npublic:\n    int minimumRightShifts(vector<int>& nums) {\n        \n        int n = nums.size();\n        int i;\n        vector<int>v = nums;\n        sort(v.begin(),v.end());\n        \n        int k = 1;\n        int ans = 0;\n        if(nums == v)\n        {\n            return ans;\n        }\n        while(ans < n)\n        {\n            reverse(nums.begin(),nums.end());\n            reverse(nums.begin()+k,nums.end());\n            reverse(nums.begin(),nums.begin()+k);\n            ans++;\n            if(nums == v)\n            {\n                return ans;\n            }\n        }\n        return -1;\n    }\n};
['C']