Write a function that add two numbers A and B.
class Solution:
"""
@param a: An integer
@param b: An integer
@return: The sum of a and b
"""
def aplusb(self, a, b):
# write your code here
while True:
a, b = a^b, (a&b)<<1
if a==0 or b == 0:
return a or b
Hint Your code ran too much time than we expected. Check your time complexity. Time limit exceeded usually caused by infinite loop if your time complexity is the best.