100% beats
IntuitionApproachComplexity
Time complexity:

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

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

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

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

# Code
```cpp []
class Solution {
public:
    bool isPower(int n) {
        if (n == 1)
            return true;
        if (n % 2 != 0)
            return false;
        if (n <= 0)
            return false;
        while (n > 1) {
            if (n % 2 != 0) {
                return false;
            }
            n = n / 2;
        }
        return true;
    }
    int smallestNumber(int n) {
        if(n==1)return n;
        int temp = n;
        while(temp>=n){
            if (isPower(temp) and temp>=n) {
                int x=temp-1;
                if(x>=n){
                    return x;
                }
                else{
                    temp++;
                }
            }
            else{
                temp++;
            }
        }
        return 0;
    }
};
```
['C++']