Number Complement | 100% | Bit Manipulation Approach | Java
class Solution {\n\n    public int findComplement(int n) {\n        int number_of_bits = (int) (Math.floor(Math.log(n) / Math.log(2))) + 1;\n        return ((1 
class Solution {\n\n    public int findComplement(int n) {\n        int number_of_bits = (int) (Math.floor(Math.log(n) / Math.log(2))) + 1;\n        return ((1 << number_of_bits) - 1) ^ n;\n    }\n}\n\n**Please help to UPVOTE if this post is useful for you.\nIf you have any questions, feel free to comment below.\nHAPPY CODING :)\nLOVE CODING :)**
['Bit Manipulation']