🚀 Smallest Number with Same Binary Length 🔢
IntuitionThe goal is to find the smallest possible number that has the same number of binary digits as the given number n.Observations:
The smallest number with
## Intuition
The goal is to find the smallest possible number that has the same number of binary digits as the given number `n`. 

Observations:
1. The smallest number with a given binary length consists of all `1`s in binary representation.
2. Converting `n` to binary helps determine its length.
3. Constructing a new binary number with all `1`s of the same length ensures it is the smallest possible number with that length.

## Approach
1. Convert `n` to its binary representation using `bin(n)[2:]` to remove the `0b` prefix.
2. Determine the length of the binary string.
3. Construct a new binary string consisting entirely of `1`s with the same length.
4. Convert the new binary string back to an integer.

## Complexity
- **Time Complexity**: $$O(\log n)$$  
  - The binary conversion and string operations take logarithmic time relative to `n`.
- **Space Complexity**: $$O(1)$$  
  - Only a few integer and string variables are used.

## Code
```python
class Solution:
    def smallestNumber(self, n: int) -> int:
        # Convert to binary and find its length
        binary_string = bin(n)[2:]
        # Create the smallest number with the same binary length
        return int('1' * len(binary_string), 2)

['Python3']