We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 957df22 commit cdfe891Copy full SHA for cdfe891
476-number-complement/number-complement.cpp
@@ -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