mirror of
https://git.wolves.top/wolves/leetcode.git
synced 2025-11-04 17:26:32 +08:00
init
This commit is contained in:
14
23/08/Q2235.cpp
Normal file
14
23/08/Q2235.cpp
Normal file
@@ -0,0 +1,14 @@
|
||||
//
|
||||
// Created by 李洋 on 2023/8/19.
|
||||
//
|
||||
class Q2235 {
|
||||
public:
|
||||
int sum(int num1, int num2) {
|
||||
while (num2) {
|
||||
unsigned int carry = (unsigned int) (num1 & num2) << 1;
|
||||
num1 ^= num2;
|
||||
num2 = carry;
|
||||
}
|
||||
return num1;
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user