c++|O(n)|Simple Logic
class Solution {\npublic:\n\n    int minOperations(vector& nums) {\n        int count = 0;\n        for(int i=1;i= nums[i]) {\n                count = count + (
class Solution {\npublic:\n\n    int minOperations(vector<int>& nums) {\n        int count = 0;\n        for(int i=1;i<nums.size();i++) {\n            if(nums[i-1] >= nums[i]) {\n                count = count + ((nums[i-1]+1)-nums[i]);\n                nums[i] = nums[i-1] +1;\n            }\n        }\n        return count;\n    }\n};
['C']