C++ Easy to understand 4 Lines only
\nclass Solution {\npublic:\n        int minOperations(vector<int>& nums) {\n    int res = 0, last = 0;\n    for (auto n : nums) {\n        res += max(0, last -
```\nclass Solution {\npublic:\n        int minOperations(vector<int>& nums) {\n    int res = 0, last = 0;\n    for (auto n : nums) {\n        res += max(0, last - n + 1);\n        last = max(n, last + 1);\n    }\n            return res;\n    }    \n};\n```
['C']