Skip to content

Commit 1ad29e0

Browse files
committed
- Add: Sum of Two Integers
1 parent 2b0a378 commit 1ad29e0

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
class Solution {
2+
fun getSum(a: Int, b: Int): Int =
3+
if (b == 0) a
4+
else getSum(a xor b, (a and b) shl 1)
5+
}

0 commit comments

Comments
 (0)