package leetcode;

/**
 * https://leetcode.com/problems/sum-of-two-integers/
 */
public class Problem371 {
    public int getSum(int a, int b) {
        return 0;
    }

    public static void main(String[] args) {
        Problem371 prob = new Problem371();
        System.out.println(prob.getSum(1, 3)); // 4
        System.out.println(prob.getSum(1, -3)); // -2
        System.out.println(prob.getSum(1, 1)); // 2
    }
}

@@ -150,271 +150,238 @@
     
-return 0
+int result = a %5E b
 ;%0A    
-%7D%0A%0A
     
-public static void main(String%5B%5D args) %7B%0A        Problem371 prob = new Problem371();%0A        System.out.println(prob.getSum(1, 3)); // 4%0A        System.out.println(prob.getSum(1, -3)); // -2%0A        System.out.println(prob.getSum(1, 1)); // 2
+int carry = a & b;%0A        while (carry != 0) %7B%0A            int shiftedCarry = carry %3C%3C 1;%0A            carry = result & shiftedCarry;%0A            result %5E= shiftedCarry;%0A        %7D%0A        return result;
 %0A   

Solve problem 371