solved using deque
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:\no(n)\n\n- Space complexity:\no(n)\n\n# Code\n```\nclass Solution {\npublic:\n    int minimumRightShifts(vector<int>& nums) {\n         deque<int> dq;\n         if(is_sorted(nums.begin(),nums.end())){\n             return 0;\n         }\n         for(int i=0; i<nums.size(); i++){\n             dq.push_back(nums[i]);\n         }\n         int count=0;\n         while(!dq.empty() && count!=nums.size()){\n             count++;\n            int ele= dq.back();\n            dq.pop_back();\n             dq.push_front(ele);\n             if(is_sorted(dq.begin(),dq.end())){\n                 return count;\n             }\n            \n             \n         }\n         return -1;\n    }\n};\n```
['C++']