number = 12
def step(n, step)
return step if n == 1
n = n % 2 == 0 ? n / 2 : n -= 1
step(n, step + 1)
puts step(number, 0)
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.