class Solution {
public int getSum(int a, int b) {
while (b != 0) {
int carry = (a & b) << 1;
a = a ^ b;
b = carry;
}
return a;
}
}
Leetcode 371 两整数之和
于 2022-03-01 21:43:26 首次发布