C++ super-simple, short and easy solution, 0 ms, fatser than 100%
\nclass Solution {\npublic:\n    int countDigits(int n) {\n        if (n == 0)\n            return 0;\n        return 1 + countDigits(n>>1);\n    }\n    \n    i
```\nclass Solution {\npublic:\n    int countDigits(int n) {\n        if (n == 0)\n            return 0;\n        return 1 + countDigits(n>>1);\n    }\n    \n    int bitwiseComplement(int N) {\n        if (N == 0) return 1;\n        return pow(2, countDigits(N)) - 1 - N;\n    }\n};\n```\n**Like it? please upvote...**
['C']