simple and easy C++ solution 😍❤️‍🔥
if it\'s help, please up \u2B06 vote! \u2764\uFE0F\n\n\n# Code\n\nclass Solution {\npublic:\n    int minOperations(vector<int>& nums) \n    {\n        int ans =
# if it\'s help, please up \u2B06 vote! \u2764\uFE0F\n\n\n# Code\n```\nclass Solution {\npublic:\n    int minOperations(vector<int>& nums) \n    {\n        int ans = 0, n = nums.size();\n        vector<int>temp = nums;\n        for(int i=0;i<n-1;i++)\n        {\n            if(temp[i] >= temp[i+1])\n                temp[i+1] = temp[i]+1;\n        }\n        for(int i=0;i<n;i++)\n            ans += temp[i] - nums[i];\n        return ans;\n    }\n};\n```
['Array', 'Greedy', 'C++']