FASTEST way with JAVA(2ms)
Code\n\nclass Solution {\n    public int minOperations(int[] nums) {\n        int count = 0;\n        int dep   = nums[0];\n        for(int a = 0; a < nums.leng
# Code\n```\nclass Solution {\n    public int minOperations(int[] nums) {\n        int count = 0;\n        int dep   = nums[0];\n        for(int a = 0; a < nums.length-1; a++){\n            if(dep>=nums[a+1]){\n                dep++;\n                count += dep-nums[a+1];\n            }else{\n                dep = nums[a+1];\n            }\n        }\n        return count;\n    }\n}\n```
['Java']