class Solution {
public:
int getSum(int a, int b) {
if(a==0)
return b;
if(b==0)
return a;
while(b!=0)
{
int carry=a&b;
a=a^b;
b=carry<<1;
}
return a;
}
};
371. Sum of Two Integers
最新推荐文章于 2023-12-20 00:06:20 发布