LeetCode 371 Sum of Two Integers - Problem Statement

The problem

Calculate the sum of two integers without using the + or - operators.

With a = 1, b = 2:

  • Binary: 1 = 01, 2 = 10.
  • Sum = 3 = 11.
  • Return 33.

With a = 2, b = 3:

  • Binary: 2 = 10, 3 = 11.
  • Sum = 5 = 101.
  • Return 55.

Constraints: 1000a,b1000-1000 \le a, b \le 1000.