class Solution {
public:
int getSum(int a, int b) {
if(!a) return b;
int sum=a^b,carry=(unsigned)(a&b)<<1;
return getSum(carry,sum);
}
};
力扣[LeetCode].371.两整数之和
猜你喜欢
转载自blog.csdn.net/weixin_45488131/article/details/108902111
今日推荐
周排行