92 - 两整数之和
题目
解答
var getSum = function (a, b) {
while (b != 0) {
let res = (a & b) << 1
a = a ^ b
b = res
}
return a
};Last updated
var getSum = function (a, b) {
while (b != 0) {
let res = (a & b) << 1
a = a ^ b
b = res
}
return a
};Last updated
func getSum(a int, b int) int {
for b != 0 {
res := (a & b) << 1
a = a ^ b
b = res
}
return a
}