[Python3] sweep
\nclass Solution:\n    def minOperations(self, nums: List[int]) -> int:\n        ans = 0\n        for i in range(1, len(nums)):\n            if nums[i-1] >= num
```\nclass Solution:\n    def minOperations(self, nums: List[int]) -> int:\n        ans = 0\n        for i in range(1, len(nums)):\n            if nums[i-1] >= nums[i]: \n                ans += 1 + nums[i-1] - nums[i]\n                nums[i] = 1 + nums[i-1]\n        return ans \n```
['Python3']