[JAVA] s'mple short O(n) solution
if you like it pls upvote\n\nJAVA\n\nclass Solution {\n    public int minOperations(int[] nums) {\n        int res = 0;\n        for(int i = 1;i<nums.length;i++
if you like it pls upvote\n\nJAVA\n```\nclass Solution {\n    public int minOperations(int[] nums) {\n        int res = 0;\n        for(int i = 1;i<nums.length;i++){\n            if(nums[i]<=nums[i-1]){\n                res+= nums[i-1]-nums[i]+1;\n                nums[i] = nums[i-1]+1;\n            }\n        }\n        return res;\n    }\n}\n```
['Java']