AlgoLounge

Sum of Two Integers

medium

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

Examples

Example 1

Input:  a = 1, b = 2
Output: 3

Example 2

Input:  a = 2, b = 3
Output: 5

Constraints

  • -1000 <= a, b <= 1000
TypeScript
Loading editor…
List of test cases (8)
Case 1
a = 1
b = 2
Case 2
a = 2
b = 3
Case 3
a = 0
b = 0
Case 4
a = -1
b = 1
Case 5
a = 5
b = 7
Case 6
a = -12
b = -8
Case 7
a = 100
b = -100
Case 8
a = 15
b = 15