JavaScript faster than 85%
\nconst minOperations = nums => {\n    let prevEl = nums[0];\n    let counter = 0;\n    \n    for (let i = 0; i < nums.length - 1; i += 1) {\n        if (nums[i
```\nconst minOperations = nums => {\n    let prevEl = nums[0];\n    let counter = 0;\n    \n    for (let i = 0; i < nums.length - 1; i += 1) {\n        if (nums[i + 1] <= prevEl) {\n            const diff = prevEl + 1 - nums[i+1] \n            counter += diff\n            prevEl += 1\n        } else {\n            prevEl = nums[i+1]\n        }\n    }\n\n    return counter;\n};\n```
['JavaScript']