[C++] Find the minimum value and move it
Intuition\n Describe your first thoughts on how to solve this problem. \nHow to move the minimum value to the begin of the array?\n\n# Approach\n Describe your 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nHow to move the minimum value to the begin of the array?\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n1. find the minimum value and its index\n2. check the array is in the rotated increasing order\n3. calculate the distance from the minimum value to the begin (right-shift)\n\n# Complexity\n- Time complexity: $$O(n)$$\n<!-- Add your time complexity here, e.g. $$O(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        // find the minimum value and its index\n        int n = nums.size();\n        int min_value = nums[0];\n        int min_value_index = 0;\n        for (int i = 0; i < n; i++) {\n            if (nums[i] < min_value) {\n                min_value = nums[i];\n                min_value_index = i;\n            }\n        }\n        \n        // check the array is in the rotated increasing order\n        for (int i = 0; i < (n - 1); i++) {\n            if (nums[(min_value_index + i) % n] > nums[(min_value_index + i + 1) % n]) return -1;\n        }\n        \n        // calculate the distance from the minimum value to the begin (right-shift)\n        return (n - min_value_index) % n;\n    }\n};\n```
['Array', 'Sorting', 'C++']