Log(n) easy understanding solution
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
```java []
class Solution {
    public int smallestNumber(int n) {
        // 2 ^ n - 1 >= n --> 2^n >= n + 1
        int smallBiger = n + 1;
        int digit = 0;
        while(smallBiger > 1) {
            if (smallBiger % 2 != 0) {
                smallBiger += 1;
            }
            smallBiger = smallBiger / 2;
            digit++;
        }

        
        return (int)Math.pow(2, digit) - 1;
        
    }
}
```
['Java']