diff --git a/3370. Smallest Number With All Set Bits b/3370. Smallest Number With All Set Bits new file mode 100644 index 0000000..417fc3b --- /dev/null +++ b/3370. Smallest Number With All Set Bits @@ -0,0 +1,10 @@ +class Solution { +public: + int smallestNumber(int n) { + int x = 1; + while (x < n) { + x = (x << 1) + 1; + } + return x; + } +};