sort 🔥
Code
# Code
```cpp []
class Solution {
public:
    int minimumRightShifts(vector<int>& nums) {
        vector<int> srt(nums), copy(nums);
        sort(srt.begin(), srt.end());

        if (srt == nums) {
            return 0;
        }

        vector<int> answer(nums.size());
        int count = 0;
        while (!(answer == copy)) {

            for (int i = 0; i < nums.size(); ++i) {
                answer[(i + 1) % nums.size()] = nums[i];
            }

            count++;

            if (answer == srt) {
                return count;
            }

            nums = answer;
        }

        return -1;
    }
};
```
['Array', 'Sorting', 'C++']