90% fast || c++ || O(N)
\n    int minOperations(vector<int>& nums) {\n        if(nums.size()==1)\n            return 0;\n        int count=0;\n        for(int i=1;i<nums.size();i++)\n 
```\n    int minOperations(vector<int>& nums) {\n        if(nums.size()==1)\n            return 0;\n        int count=0;\n        for(int i=1;i<nums.size();i++)\n        {\n            if(nums[i]==nums[i-1])\n            {\n                nums[i]++;\n                count++;\n            }\n            else if(nums[i]<nums[i-1])\n            {\n                int t=nums[i-1]-nums[i];\n                t++;\n                nums[i]=nums[i]+t;\n                count+=t;\n            }   \n        }\n        return count;\n    }\n```
['C', 'C++']