Best Approach ||  C++ || TC : O(n) || SC : O(n) || Easy to understand
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    int minimumRightShifts(vector<int>& nums) {\n        int  n = nums.size(),ind = -1,cnt{};\n        for(int i=0;i<n-1;i++){\n            if(nums[i]>nums[i+1]){\n                if(cnt==0){\n                ind = i+1;\n                cnt++;\n                }else return -1;\n            }\n        }\n        if(ind==-1) return 0;\n        if(nums[n-1]>nums[0]) return -1;\n        return n-ind;\n    }\n};\n```
['C++']