optimal approach: o(logn)
IntuitionApproach :Best approachBy using left shift operatorComplexity
Time complexity:O(LogN)

Space complexity:O(1)
Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach :Best approach
By using left shift operator

<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity:O(LogN)
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity:O(1)
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```cpp []
class Solution {
public:
    int smallestNumber(int n) {
        int pow=1;
        while(pow<n){
          pow=pow<<1|1 ; 
        }  
     return pow;
    }
};
```
['C++']