C++ easy solution TC:O(n) SC:O(n)
\nclass Solution {\npublic:\n    int minOperations(vector<int>& nums) {\n        if(nums.size()==1) return 0;\n        int count=0,sum=0;\n        for(int i=1;i
```\nclass Solution {\npublic:\n    int minOperations(vector<int>& nums) {\n        if(nums.size()==1) return 0;\n        int count=0,sum=0;\n        for(int i=1;i<nums.size();i++){\n            if(nums[i]<=nums[i-1]){\n                count+=nums[i-1]+1;\n                sum+=count-nums[i];\n                nums[i]=count;\n                count=0;\n            }\n        }\n        return sum;\n    }\n};\n```
['C', 'C++']