package leetcode;

/**
 * https://leetcode.com/problems/minimum-flips-to-make-a-or-b-equal-to-c/
 */
public class Problem1318 {
    public int minFlips(int a, int b, int c) {
        // TODO
        return 0;
    }

    public static void main(String[] args) {
        Problem1318 prob = new Problem1318();
        System.out.println(prob.minFlips(2, 6, 5)); // 3
        System.out.println(prob.minFlips(4, 2, 7)); // 1
        System.out.println(prob.minFlips(1, 2, 3)); // 0
    }
}

@@ -180,302 +180,536 @@
     
-// TODO%0A        return 0;%0A
+int answer = 0;%0A        while (a %3E 0 %7C%7C b %3E 0 %7C%7C c %3E 0) %7B%0A 
     
-%7D%0A%0A
     
-public static void main(String%5B%5D args) %7B%0A        Problem1318 prob = new Problem1318();%0A        System.out.println(prob.minFlips(2, 6, 5)); // 3%0A        System.out.println(prob.minFlips(4, 2, 7)); // 1%0A        System.out.println(prob.minFlips(1, 2, 3)); // 0
+   if ((c & 1) == 1) %7B%0A                if ((a & 1) == 0 && (b & 1) == 0) %7B%0A                    answer++;%0A                %7D%0A            %7D else %7B // (c & 1) == 0%0A                if ((a & 1) == 1 && (b & 1) == 1) %7B%0A                    answer += 2;%0A                %7D else if ((a & 1) == 1 %7C%7C (b & 1) == 1) %7B%0A                    answer++;%0A                %7D%0A            %7D%0A            a %3E%3E= 1;%0A            b %3E%3E= 1;%0A            c %3E%3E= 1;%0A        %7D%0A        return answer;
 %0A   

Solve problem 1318