227. Sum of Two Integers
MediumBit Manipulation
Given two integers x and y, return the sum of the two integers without using the operators + and -.
Examples
Input: 1 2
Output: 3
Explanation: 1 + 2 = 3 computed with XOR (sum bits) and AND<<1 (carry) instead of +.
Constraints
- -1000 <= a, b <= 1000
Loading...
Run checks all cases above. Submit evaluates all test cases.