Elixir solution.
IntuitionApproachComplexity
Time complexity: 0ms

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

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

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

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

# Code
```elixir []
defmodule Solution do
  @spec smallest_number(n :: integer) :: integer
  def smallest_number(n) do
    smallest_number(n, 1)
  end

  @spec smallest_number(n :: integer, cur :: integer) :: integer
  def smallest_number(n, cur) when cur - 1 < n do
    smallest_number(n, cur*2)
  end

  def smallest_number(_n, cur) do
    cur - 1
  end
end

```
['Elixir']