easy to understand JS
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:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\n/**\n * @param {number[]} nums\n * @return {number}\n */\nvar minimumRightShifts = function(nums) {\n    let c=0\n    let pivot\n    for(let i=1;i<nums.length;i++){\n        if(c>0 && (nums[i]<nums[i-1]||nums[i]>nums[0])) return -1\n        if(nums[i]<nums[i-1]){\n            pivot=i\n            c++\n        }\n    }\n    return c==0 ? 0:nums.length-pivot\n};\n\n```
['JavaScript']