n steps with 1, 2 or 3 steps taken. How many ways to get to the top?

前端 未结 13 887
时光说笑
时光说笑 2020-12-08 08:12

If we have n steps and we can go up 1 or 2 steps at a time, there is a Fibonacci relation between the number of steps and the ways to climb them. IF and ONLY if we do not co

13条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-08 09:01

    Maybe its just 2^(n-1) with n being the number of steps?

    It makes sence for me because with 4 steps you have 8 possibilities:

    4,
    3+1,
    1+3,
    2+2,
    2+1+1,
    1+2+1,
    1+1+2,
    1+1+1+1,
    

    I guess this is the pattern

提交回复
热议问题