C++ O(1) Clean 1-Line bit_width
Complexity\n- Time complexity: $O(1)$\n\n- Space complexity: $O(1)$\n\n# Code\ncpp []\nclass Solution {\npublic:\n    int smallestNumber(int n) {\n        retur
# Complexity\n- Time complexity: $O(1)$\n\n- Space complexity: $O(1)$\n\n# Code\n```cpp []\nclass Solution {\npublic:\n    int smallestNumber(int n) {\n        return (1 << bit_width(unsigned(n))) - 1;\n    }\n};\n```
['C++']