Sum of two numbers without using arithmetic operators
Easy Accuracy: 76.58%
Submissions: 9077 Points: 2
Given two integers a and b. Find the sum of two numbers without using arithmetic operators.
a = 5, b = 3
5 + 3 = 8
a = 10, b = 30
10 + 30 = 40
You don't need to read input or print anything. Your task is to complete the function sum() which takes two integers a and b as input and returns the sum of a and b, which is calculated without using any arithmetic operator.
Expected Time Complexity : O(max(number of bits in 'a', number of bits in 'b'))