๋ฌธ์ ์ ๊ทผ
โข
๋นํธ ์ฐ์ฐ
๋์ณค๋ ๋ถ๋ถ
์ฝ๋
5.9 MB
3 ms
class Solution {
public:
int findComplement(long num) {
long long i;
for (i = 1; i <= num; i <<= 1)
num ^= i;
return num;
}
};
C++
๋ณต์ฌ