There was an error while loading. Please reload this page.
1 parent 63e4bc1 commit 90121c3Copy full SHA for 90121c3
Bitwise/371_Sum_of_Two_Integers.java
@@ -0,0 +1,11 @@
1
+class Solution {
2
+ public int getSum(int a, int b) {
3
+ while (b != 0) {
4
+ int carry = a & b;
5
+ a ^= b;
6
+ b = carry << 1;
7
+ }
8
+
9
+ return a;
10
11
+}
0 commit comments