Simple Go, no bit manipulation
ApproachWe need find power of 2 that is bigger than the given number and subtract 1.5 -> 101
next greater number that is a power of 2 is 8
8 -> 1000
subtract 1
# Approach
We need find power of 2 that is bigger than the given number and subtract 1.

5 -> 101
next greater number that is a power of 2 is 8
8 -> 1000
subtract 1
7 -> 111
Same length as 5 in binary representation, but all bits are ones

# Complexity
- Time complexity:
O(log(n))

- Space complexity:
O(n)

# Code
```golang []
func smallestNumber(n int) int {
    result := 1
    for result <= n {
        result *= 2
    }
    return result - 1
}
```
['Go']