package com.fishercoder.solutions;

/**Calculate the sum of two integers a and b, but you are not allowed to use the operator + and -.

 Example:
 Given a = 1 and b = 2, return 3.*/
public class _371 {

    /**reference: http://stackoverflow.com/questions/9070937/adding-two-numbers-without-operator-clarification*/
    public int getSum(int a, int b) {
        if (b == 0) {
            return a;
        }
        int sum = a ^ b;
        int carry = (a & b) << 1;
        return getSum(sum, carry);
    }
}

@@ -32,16 +32,51 @@
 ns;%0A%0A/**
+%0A * 371. Sum of Two Integers%0A *%0A * 
 Calculat
@@ -207,16 +207,18 @@
 eturn 3.
+%0A 
 */%0Apubli
@@ -237,15 +237,56 @@
  %7B%0A%0A
+    public static class Solution1 %7B%0A    
     /**
+ 
 refe
@@ -384,19 +384,24 @@
 fication
+ 
 */%0A
+    
     publ
@@ -438,16 +438,20 @@
         
+    
 if (b ==
@@ -464,24 +464,28 @@
             
+ 
+   
 return a;%0A  
@@ -490,16 +490,20 @@
         
+    
 %7D%0A      
@@ -500,24 +500,28 @@
   %7D%0A        
+ 
+   
 int sum = a 
@@ -525,16 +525,20 @@
  a %5E b;%0A
+    
         
@@ -567,24 +567,28 @@
  1;%0A        
+    
 return getSu
@@ -602,16 +602,26 @@
 carry);%0A
+        %7D%0A
     %7D%0A%7D%0A

refactor 371