Smallest number with all set bits
Approach2^n-1 has all set bits
case 1:n=3
2^3-1=8-1=7
7 has all set  bits "111"Complexity
Time complexity:
O(1)--->100%
Code
# Approach
2^n-1 has all set bits
case 1:n=3
2^3-1=8-1=7
7 has all set  bits "111"

# Complexity
- Time complexity:
O(1)--->100%


# Code
```python3 []
class Solution:
    def smallestNumber(self, n: int) -> int:
        i=0
        while(1):
            if pow(2,i)-1<n:
                i+=1
            else:
                return pow(2,i)-1
```
['Python3']