Java Easy Solution 2ms
class Solution {\n    public int minOperations(int[] nums) {\n        int n=nums.length;\n        int count=0;\n        for(int i=0;i<n-1;i++)\n        {\n     
class Solution {\n    public int minOperations(int[] nums) {\n        int n=nums.length;\n        int count=0;\n        for(int i=0;i<n-1;i++)\n        {\n            if(nums[i+1]<=nums[i])\n            {\n                int r=nums[i]-nums[i+1]+1;\n                count+=r;\n                nums[i+1]+=r;\n            }\n        }\n        return count;\n    }\n}
[]