C++ Solution || Simple Approach
Complexity\n- Time complexity: O(n)\n Add your time complexity here, e.g. O(n) \n\n- Space complexity: O(1)\n Add your space complexity here, e.g. O(n) \n\n# Co
# Complexity\n- Time complexity: O(n)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: O(1)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    int minOperations(vector<int>& nums) {\n\n    if(nums.size()==1)\n        return 0;\n    int n=nums.size();\n    int count = 0;\n    for (int i = 1; i < n; i++)\n    {\n        if (nums[i] <= nums[i - 1])\n        {\n            count += abs(nums[i - 1] + 1 - nums[i]);\n            nums[i] = nums[i - 1] + 1;\n        }\n    }\n    return count;\n\n    }\n};\n```
['C++']