Skip to content

Commit cdfe891

Browse files
committed
Time: 0 ms (100.00%) | Memory: 8.2 MB (7.69%) - LeetSync
1 parent 957df22 commit cdfe891

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
class Solution {
2+
public:
3+
int findComplement(int num) {
4+
return (pow(2,floor(log2(num))+1)-1)-num;
5+
}
6+
};

0 commit comments

Comments
 (0)