LC371 - Sum of Two Integers
Problem
Given two integers a
and b
, return the sum of the two integers without using the operators +
and -
.
Example
Input: a = 1, b = 2
Output: 3
Solution
Pseudocode
Time and space complexity is .
Python
Because Python integers are arbitrarily large, mask all except the rightmost 32 bits.
Last updated