Simple Javascript solution beats 95%
\n/**\n * @param {number[]} nums\n * @return {number}\n */\nvar minOperations = function(nums) {\n    let ops = 0, prevNum = nums[0]\n    for(let i = 1; i < num
```\n/**\n * @param {number[]} nums\n * @return {number}\n */\nvar minOperations = function(nums) {\n    let ops = 0, prevNum = nums[0]\n    for(let i = 1; i < nums.length; i++){\n        if(nums[i] <= prevNum){\n            ops += prevNum + 1 - nums[i]\n            nums[i] = prevNum + 1\n        }\n        prevNum = nums[i]\n    }\n    return ops\n};\n```
['JavaScript']