package leetcode;

/**
 * https://leetcode.com/problems/broken-calculator/
 */
public class Problem991 {
    public int brokenCalc(int X, int Y) {
        // TODO
        return 0;
    }

    public static void main(String[] args) {
        Problem991 prob = new Problem991();
        System.out.println(prob.brokenCalc(2, 3)); // 2
        System.out.println(prob.brokenCalc(5, 8)); // 2
        System.out.println(prob.brokenCalc(3, 10)); // 3
        System.out.println(prob.brokenCalc(1024, 1)); // 1023
    }
}

@@ -152,24 +152,32 @@
     
-// TODO%0A
+if (X == Y) %7B%0A  
         
 retu
@@ -172,16 +172,18 @@
         
+  
 return 0
@@ -184,16 +184,296 @@
 turn 0;%0A
+        %7D%0A        int a = Integer.MAX_VALUE;%0A        int b = Integer.MAX_VALUE;%0A        if (X %3C Y) %7B%0A            a = brokenCalc(X * 2, Y) + 1;%0A        %7D%0A        if (X %3E Y) %7B%0A            b = brokenCalc(X - 1, Y) + 1;%0A        %7D%0A        int min = Math.min(a, b);%0A        return min;%0A
     %7D%0A%0A 
@@ -560,16 +560,18 @@
 m991();%0A
+//
         
@@ -610,32 +610,34 @@
 lc(2, 3)); // 2%0A
+//
         System.o
@@ -733,16 +733,18 @@
 ); // 3%0A
+//
         

Update problem 991