Python simplest one-liner solution
\nclass Solution:\n    def bitwiseComplement(self, N: int) -> int:\n        return (2**len(bin(N)[2:]))-1-N if N != 0 else 1\n\nLike it? please upvote...
```\nclass Solution:\n    def bitwiseComplement(self, N: int) -> int:\n        return (2**len(bin(N)[2:]))-1-N if N != 0 else 1\n```\n**Like it? please upvote...**
['Python3']