diff --git a/2201/220104.cpp b/2201/220104.cpp new file mode 100644 index 0000000..3cbdb27 --- /dev/null +++ b/2201/220104.cpp @@ -0,0 +1,12 @@ +#include + +class Solution { +public: + static int bitwiseComplement(int n) { + return n ? ((1 << ((31 ^ __builtin_clz(n)) + 1)) - 1) ^ n : 1; + } +}; + +int main() { + std::printf("%d\n", Solution::bitwiseComplement(0)); +} \ No newline at end of file