Simple C++ code || beats 94.88% and 84.15% ✌
\n# Approach\n Describe your approach to solving the problem. \niterates through index =1, checks if the element in the current index is smaller than the elemen
\n# Approach\n<!-- Describe your approach to solving the problem. -->\niterates through index =1, checks if the element in the current index is smaller than the element in the previous one, if it is then adds value equal to previousElement - currentElement + 1 , also stores the increased number to a counter to return later, \n\nthat\'s all , \u270C\n\n- Time Complexity: O(n)\n\n- Runtime: Beats 94.88%\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n\n- Memory: Beats 84.15%\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    int minOperations(vector<int>& nums) {\n        int c=0;\n        int n=nums.size();\n\n        for(int i=1;i<n;i++){\n            if(nums[i]<=nums[i-1]){\n                c=c+(nums[i-1]-nums[i])+1;\n                nums[i]=nums[i]+(nums[i-1]-nums[i])+1;\n            }\n        }\n        return c;\n    }\n};\n```\n\nHope you liked the implementation of the code, if you like it feel free to upvote \uD83D\uDC4D\nKeep Coding , Keep Chilling
['C++']