✅ Short & Easy Solution w/ Explanation | 4 Lines of Code!
\u2714\uFE0F Solution - I\n\nThe problem can be solved as -\n\n1. Just iterate over the array.\n2. If at any point, nums[i] <= nums[i - 1], then we need to incr
\u2714\uFE0F ***Solution - I***\n\nThe problem can be solved as -\n\n1. Just iterate over the array.\n2. If at any point, `nums[i] <= nums[i - 1]`, then we need to increment `nums[i]` to make the array strictly increasing. The number of increments needed is given by - `nums[i - 1] + nums[i] + 1`. Basically, it is the number of increments needed to take `nums[i]` to atleast `nums[i - 1] + 1`.\n3. Return the number of increments.\n\n```\nint minOperations(vector<int>& nums) {\n\tint cnt = 0;\n\tfor(int i = 1; i < size(nums); i++)\n\t\tif(nums[i] <= nums[i - 1]) {  \n\t\t\tcnt += (nums[i - 1] - nums[i] + 1), // nums[i] must be made atleast equal to nums[i-1]+1\n\t\t\tnums[i] = nums[i - 1] + 1;\n\t\t}\n\treturn cnt;\n}\n```\n\n***Time Complexity :*** **`O(N)`**\n***Space Complexity :*** **`O(1)`**\n\n---\n\n\u2714\uFE0F ***Solution - II (Shorter Version of Solution - I)***\n\nThe below solution is same as solution - I, just a shorter, more concise version.\n\n```\nint minOperations(vector<int>& nums) {\n\tint cnt = 0;\n\tfor(int i = 1; i < size(nums); i++)\n\t\tcnt += max(0, nums[i - 1] + 1 - nums[i]), nums[i] = max(nums[i], nums[i - 1] + 1);\n\treturn cnt;\n}\n```\n\n---\n---
['C']