1 Line Code
Code\ncpp []\nclass Solution {\npublic:\n    int minimumRightShifts(vector<int>& nums) {int n = distance(nums.begin(), min_element(nums.begin(), nums.end()));\n
# Code\n```cpp []\nclass Solution {\npublic:\n    int minimumRightShifts(vector<int>& nums) {int n = distance(nums.begin(), min_element(nums.begin(), nums.end()));\n    return is_sorted(nums.begin(), nums.end()) ? 0 : (is_sorted(nums.begin() + n, nums.end()) && is_sorted(nums.begin(), nums.begin() + n) && nums.back() <= nums.front() ? nums.size() - n : -1);\n    }\n};\n\n```
['C++']