Tag: sumoftwointegers

  • Data Structures & Algorithms in Java – Binary – Sum of two integers

    Problem : Given two integers, add them without using + and – operators. Input: a = 3 b= 5 Output: 8 Try out the solution here: https://leetcode.com/problems/sum-of-two-integers/ Hint: Use bitwise operators Solution: Let’s solve the problem using bitwise operators XOR, AND and SHIFT. Adding two binary numbers is equal to performing XOR operation between them…