题解 | #另类加法#
另类加法
http://www.nowcoder.com/practice/e7e0d226f1e84ba7ab8b28efc6e1aebc
# -*- coding:utf-8 -*-
class UnusualAdd:
def addAB(self, A, B):
# write code here
while B:
C = A ^ B
B = (A & B) << 1
A = C
return A