Sum of Two Integers
Math
medium
Score: 30
Given two integers a
and b
, return the sum of the two integers without using the operators +
and -
.
Input Format:
First parameter: integer a
Second parameter: integer b
Output format:
Return the sum
Example 1:
Input: a = 1, b = 2
Output:
3
Example 2:
Input: a = 2, b = 3
Output:
5
Constraints:
- -103 <=
a, b
<= 103 - Expected Time Complexity: O(1)
- Expected Space Complexity: O(1)