C++ easy solution beats 100%
Intuition\nMake a mask \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time complexity:\n Add your time complexity here, e.g
# Intuition\nMake a mask \n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    int bitwiseComplement(int n) {\n        int m = n ; \n        int mask = 0 ; \n        \n        while(m==0){\n            return 1 ; \n        }\n        while(m!=0){\n            mask = ( mask << 1 ) | 1 ;\n            m = m >> 1 ; \n        }\n        int ans = (~n) & mask;\n            return ans ; \n    }\n};\n```
['C++']