Sum of Two Integers

Given two integers a and b, return the sum of the two integers without using the operators + and -.

Example 1
Inputa = 1, b = 2
Output3
The sum of 1 and 2 is 3.
Example 2
Inputa = 2, b = 3
Output5
The sum of 2 and 3 is 5.

Constraints

  • -1000 <= a, b <= 1000

Asked at 8 companies

</>

Your Solution

(Ctrl/Cmd + Enter)

Switching Language

Loading template...

Loading...

Sign in to save your progress

AI code evaluation

Get a correctness verdict, missed edge cases, and complexity analysis of your solution.

Sign in to evaluate