Given two integers a and b, return their sum without using the + or - operators. Use bit manipulation instead.
The key idea: XOR gives the sum without carrying, and AND followed by a left shift gives the carry. Repeat until there is no carry left.
Note: Your solution should handle negative numbers correctly.
a = 1, b = 23a = 5, b = 38a = -1, b = 10-1000 <= a, b <= 1000Do not use + or - operatorsRun your code to see results
Use Cmd+Enter to run