We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6df9884 commit 17a194eCopy full SHA for 17a194e
sum-of-two-integers/hyer0705.ts
@@ -0,0 +1,10 @@
1
+function getSum(a: number, b: number): number {
2
+ while (b !== 0) {
3
+ let carry = (a & b) << 1;
4
+
5
+ a = a ^ b;
6
7
+ b = carry;
8
+ }
9
+ return a;
10
+}
0 commit comments