Easy C++ solution || Greedy approach
\n\n# Code\n\nclass Solution {\npublic:\n    int minOperations(vector<int>& nums) {\n        int n = nums.size(), count = 0;\n        if(n == 1){\n            r
\n\n# Code\n```\nclass Solution {\npublic:\n    int minOperations(vector<int>& nums) {\n        int n = nums.size(), count = 0;\n        if(n == 1){\n            return 0;\n        }\n        for(int i=1; i<n; i++){\n            if(nums[i] > nums[i-1]){\n                continue;\n            }\n            else{\n                int temp = nums[i-1] - nums[i] + 1;\n                nums[i] += temp;\n                count += temp;\n            }\n        }\n\n        return count;\n    }\n};\n```
['Array', 'Greedy', 'C++']