Easiest CPP soln || O(n) || O(1) || Must watch
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        bool flag=1;\n       for(int i=0;i<nums.size()-1;i++){\n           if(nums[i]>nums[i+1]){\n               flag=0;\n           }\n       }\n        if(flag){\n            return 0;\n        }\n        int count=0;\n        int n=nums.size();\n        if(nums[n-1]>nums[0]){\n            return -1;\n        }\n        else{\n            count++;\n        }\n        int ind=-1;\n        for(int i=n-2;i>=0;i--){\n            if(nums[i]<nums[i+1]){\n                count++;\n            }\n            else{\n                ind=i;\n                break;\n            }\n        }\n        for(int i=0;i<ind;i++){\n            if(nums[i]>nums[i+1]){\n                return -1;\n            }\n        }\n        return count;\n       \n    }\n};\n```
['C++']