✅C++ || Short && clean || O(N) && O(1)
\n\n\n\n\tclass Solution {\n\t\tpublic:\n\t\t\tint minOperations(vector& nums) {\n\t\t\t\tint k=0;\n\t\t\t\tfor(int i=0;i<nums.size()-1;i++){\n\t\t\t\t\tif(nums
![image](https://assets.leetcode.com/users/images/658bf173-a602-402a-ba65-652b855959bd_1656405656.4055514.png)\n\n\n\n\tclass Solution {\n\t\tpublic:\n\t\t\tint minOperations(vector<int>& nums) {\n\t\t\t\tint k=0;\n\t\t\t\tfor(int i=0;i<nums.size()-1;i++){\n\t\t\t\t\tif(nums[i+1]<=nums[i]){\n\t\t\t\t\t\tk+=(nums[i]-nums[i+1])+1;\n\t\t\t\t\t\tnums[i+1]=nums[i]+1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn k;\n\t\t\t}\n\t\t};
['C', 'C++']