Type Script Solution
Intuition\nMathematic Expression Approch\n\n# Approach\n- Finding the Difference between the Elements that is smaller than the\nnext element\n\n# Complexity\n- 
# Intuition\nMathematic Expression Approch\n\n# Approach\n- Finding the Difference between the Elements that is smaller than the\nnext element\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```\nfunction minOperations(nums: number[]): number {\n    let sum = 0;\n    let result = 0;\n    for (let i = 1; i < nums.length; i++) {\n        if (nums[i] <= nums[i - 1]) {\n            sum = (nums[i - 1] + 1) - nums[i]\n            nums[i] += sum\n            result += sum\n        }\n    }\n\n    return result\n};\n```
['TypeScript']