1 Star 0 Fork 0

yuhang2__2/LeetCode-Solutions

Create your Gitee Account
Explore and code with more than 13.5 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
sum-of-two-integers.cpp 223 Bytes
Copy Edit Raw Blame History
kamyu authored 9 years ago . Create sum-of-two-integers.cpp
// Time: O(1)
// Space: O(1)
class Solution {
public:
int getSum(int a, int b) {
while (b) {
int carry = a & b;
a ^= b;
b = carry << 1;
}
return a;
}
};
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/yuhang2__2/LeetCode-Solutions.git
git@gitee.com:yuhang2__2/LeetCode-Solutions.git
yuhang2__2
LeetCode-Solutions
LeetCode-Solutions
master

Search