Python O(n) simple and short solution
Python :\n\n\ndef minOperations(self, nums: List[int]) -> int:\n\tans = 0\n\n\tfor i in range(1, len(nums)):\n\t\tif nums[i] <= nums[i - 1]:\n\t\t\tans += (nums
**Python :**\n\n```\ndef minOperations(self, nums: List[int]) -> int:\n\tans = 0\n\n\tfor i in range(1, len(nums)):\n\t\tif nums[i] <= nums[i - 1]:\n\t\t\tans += (nums[i - 1] - nums[i] + 1)\n\t\t\tnums[i] = (nums[i - 1] + 1)\n\n\treturn ans\n```\n\n**Like it ? please upvote !**
['Python', 'Python3']