:orphan: Sum of Two Integers =================== .. highlight:: none Problem ------- https://leetcode.com/problems/sum-of-two-integers/ Given two integers ``a`` and ``b``, return *the sum of the two integers without using the operators* ``+`` *and* ``-``. **Example 1:** :: Input: a = 1, b = 2 Output: 3 **Example 2:** :: Input: a = 2, b = 3 Output: 5 **Constraints:** - ``-1000 <= a, b <= 1000`` .. highlight:: python Pattern ------- Bit Manipulation Approaches ---------- .. tab-set:: .. tab-item:: Bit Manipulation **Code** .. literalinclude:: ../problems/medium/sum-of-two-integers/sum_of_two_integers__bit_manipulation.py :language: python :lines: 12- **Test** >>> from sum_of_two_integers__bit_manipulation import getSum >>> getSum(1, 2) 3 >>> getSum(2, 3) 5 >>> getSum(-1, 1) 0 .. autofunction:: sum_of_two_integers__bit_manipulation.getSum