Leetcode 371. Sum of Two Integers
Compute a + b without using + or -, by performing binary addition with bitwise operations. The core challenge is emulating addition using XOR (sum without carry) and AND plus left-shift (carry propagation), iterating until no carry remains and correctly handling two's-complement negatives.
Asked at:
Meta
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
0
Mid June, 2025
Meta
Staff
Late April, 2025
Meta
Senior
Hello Interview Premium
Your account is free and you can post anonymously if you choose.