Finding all paths down stairs?

后端 未结 13 1384
天命终不由人
天命终不由人 2020-12-13 07:21

I was given the following problem in an interview:

Given a staircase with N steps, you can go up with 1 or 2 steps each time. Output all possible way

相关标签:
13条回答
  • 2020-12-13 08:22

    may be I am wrong.. but it should be :

    S(1) =0
    S(2) =1
    

    Here We are considering permutations so in that way

    S(3) =3
    S(4) =7
    
    0 讨论(0)
提交回复
热议问题