C++|| O(N) time || O(1) Space
Approach 1\nWe will first try to find the pivot point \n->if pivot point is not found then ans will be 0\n->else if pivot point is found then the arr after pivo
# Approach 1\nWe will first try to find the pivot point \n->if pivot point is not found then ans will be 0\n->else if pivot point is found then the arr after pivot point must be sorted array and  all element must be smaller then arr[0]\n\n# Complexity\n- Time complexity : O(N)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n\n- Space complexity: O(1)\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 ind=0;\n        int n=nums.size();\n        while(ind+1<n&&nums[ind]<nums[ind+1])ind++;\n        \n        if(ind==n-1)return 0;\n        \n        ind++;\n        int pivot=ind;\n       while(ind+1<n&&nums[ind]<nums[ind+1])ind++;\n        if(ind!=n-1)return -1;\n        if(nums[pivot]<nums[0]&&nums[n-1]<nums[0])\n        {\n            return n-pivot;\n        }\n        else return -1;\n        \n        \n    }\n};\n```\n\n
['C++']