C++ Easy Index find Solution
Intuition\nJust find the start point of the sorted array( if it is one)\n\n\n# Complexity\n- Time complexity: O(n) just for iterating nums\n\n- Space complexity
# Intuition\nJust find the start point of the sorted array( if it is one)\n\n\n# Complexity\n- Time complexity: O(n) just for iterating nums\n\n- Space complexity: O(1)\n\n# Code\n```\nclass Solution {\npublic:\n    int minimumRightShifts(vector<int>& nums) {\n        int count = 0,idx=0;\n        for(int i=0;i<nums.size()-1;i++){\n            if(nums[i]>nums[i+1]){\n                idx=i;\n                count++;\n            }\n        }\n        if(count==0) return 0;\n        if(nums[0]<nums.back()) return -1;\n        if(count>1) return -1;\n        return nums.size()-idx-1;\n    }\n};\n```
['C++']