Easy || Brute Force || C++ || Right Shift
Approach\nBrute Force - Easy to understand\n\n# Complexity\n- Time complexity: O(N*N)\n\n- Space complexity: O(N)\n\n# Code\n\nclass Solution {\npublic:\n    in
# Approach\nBrute Force - Easy to understand\n\n# Complexity\n- Time complexity: O(N*N)\n\n- Space complexity: O(N)\n\n# Code\n```\nclass Solution {\npublic:\n    int minimumRightShifts(vector<int>& nums) {\n        int n=nums.size();\n        vector<int> v=nums;\n        sort(v.begin(),v.end());\n        if(v==nums) return 0;\n        for(int i=0;i<n;i++){\n            int t=nums[n-1];\n            for(int i=n-2;i>=0;i--){\n                nums[i+1]=nums[i];\n            }\n            nums[0]=t;\n            // for(auto it:nums) cout<<it<<" ";\n            // cout<<endl;\n            if(v==nums) return i+1;\n        }\n        return -1;\n    }\n};\n```
['Array', 'Sorting', 'C++']