Easiest soln with 100% beats;
IntuitionApproachTHe idea is simple if n contains a no with all bit set then if we and it with the next no the ans be 0 if its 0 then return  n else -1Eg: n=5,
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
<!-- Describe your approach to solving the problem. -->
THe idea is simple if n contains a no with all bit set then if we and it with the next no the ans be 0 if its 0 then return  n else -1

Eg: n=5,
when n=7 ,n+1=8 so 111&1000 is 0 so ans is 7

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

- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->
If u like my soln upvote me
# Code
```cpp []
class Solution {
public:
    int smallestNumber(int n) {
        while(n!=0){
            int i=n;
            int a= (i&(i+1));
            if(a==0){
                return i;
            }else{
                n++;
            }
        }
        return -1;
    }
};
```
['C++']