Loading your interview setup
Skip to content
New
Loading
LarpCode 150
medium
· bit-manipulation
Mock interview
Sum of Two Integers
Given two integers `a` and `b`, return their sum without using the operators + or -.
Examples
in: a = 1, b = 2
out: 3
1 + 2
in: a = 2, b = -3
out: -1
handles negatives
Constraints
-1000 <= a, b <= 1000
Hints
Stuck? Show a hint (2 available)
Python
JavaScript
Java
C++
Go
Run
Submit
target: O(1) time
⌘↩ run · ⇧⌘↩ submit
see the solution