Easy C++ Solution
Do upvote if useful!\n\nclass Solution {\npublic:\n    int minOperations(vector<int>& nums) {\n        int output=0;\n        for(int i=0;i<nums.size()-1;i++){\
**Do upvote if useful!**\n```\nclass Solution {\npublic:\n    int minOperations(vector<int>& nums) {\n        int output=0;\n        for(int i=0;i<nums.size()-1;i++){\n            if(nums[i]<nums[i+1])\n                continue;\n            else{\n                output=output+(nums[i]+1-nums[i+1]);\n                nums[i+1]=nums[i]+1;\n            }\n        }\n        return output;\n    }\n};\n```
['C', 'C++']