C++ solution without updating the vector nums
\nclass Solution {\npublic:\n    int minOperations(vector<int>& nums) {\n            if(nums.size()==0)return 0;\n            int op=0,count=0;\n        for(int
```\nclass Solution {\npublic:\n    int minOperations(vector<int>& nums) {\n            if(nums.size()==0)return 0;\n            int op=0,count=0;\n        for(int i=1;i<nums.size();i++){\n           if(nums[i]<=nums[i-1]+count){\n                   count+=nums[i-1]-nums[i]+1;                  \n                   op+=count;\n           }\n                else count =0;\n        } \n            return op;\n        \n    }\n};\n```
[]