package leetcode;

/**
 * https://leetcode.com/problems/minimum-operations-to-make-the-array-increasing/
 */
public class Problem1827 {
    public int minOperations(int[] nums) {
        // TODO
        return 0;
    }

    public static void main(String[] args) {
        Problem1827 prob = new Problem1827();
        System.out.println(prob.minOperations(new int[]{1,1,1})); // 3
        System.out.println(prob.minOperations(new int[]{1,5,2,4,1})); // 14
        System.out.println(prob.minOperations(new int[]{8})); // 0
    }
}

@@ -184,345 +184,256 @@
     
-// TODO%0A        return 0;
+int answer = 0;%0A        for (int i = 1; i %3C nums.length; i++) %7B
 %0A    
-%7D%0A%0A
     
-public static void main(String%5B%5D args) %7B%0A        Problem1827 prob = new Problem1827();%0A        System.out.println(prob.minOperations(new int%5B%5D%7B1,1,1%7D)); // 3%0A        System.out.println(prob.minOperations(new int%5B%5D%7B1,5,2,4,1%7D)); // 14%0A        System.out.println(prob.minOperations(new int%5B%5D%7B8%7D)); // 0
+    if (nums%5Bi - 1%5D %3E= nums%5Bi%5D) %7B%0A                answer += nums%5Bi - 1%5D - nums%5Bi%5D + 1;%0A                nums%5Bi%5D = nums%5Bi - 1%5D + 1;%0A            %7D%0A        %7D%0A        return answer;
 %0A   

Solve problem 1827