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 b81d6ed commit 059a593Copy full SHA for 059a593
sum-of-two-integers/hu6r1s.py
@@ -0,0 +1,6 @@
1
+class Solution:
2
+ def getSum(self, a: int, b: int) -> int:
3
+ mask = 0xFFFFFFFF
4
+ while b & mask:
5
+ a, b = a ^ b, (a & b) << 1
6
+ return (a & mask) if b > 0 else a
0 commit comments