No Loop One Line Solution in C++ with 100% m/s
Intuition\n Describe your first thoughts on how to solve this problem. \n    No loop one line solution in c++ just bit manipulation.\n\n# Approach\n Describe yo
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n    No loop one line solution in c++ just bit manipulation.\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\njust Using the basic bitwise operations to solve the question.\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\nSolution with O(1).\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\nsolution with O(1) Space ,No extra Space.\n\n# Code\n```cpp []\nclass Solution {\npublic:\n    int findComplement(int n) {\n        return n^(2*((1<<int(log2(n)))-1)|1);\n    }\n};\n```
['C++']