Given two integers a
and b
, calculate their sum without using the +
or -
operators.
Rules:
Constraints:
Examples:
// Example 1: console.log(getSum(1, 1)); // Output: 2 // Explanation: 1 + 1 = 2 // Example 2: console.log(getSum(4, 7)); // Output: 11 // Explanation: 4 + 7 = 11
Note: You'll need to use bitwise operations to solve this problem.