Interview Questions and Answers :: Brocade
Home > Experience Archives > Brocade > Interview Question Set 7 > Discussion
4. N step staircases are there where you can claim 1 or 2 step at time. How many possible way to reach you a top.
Solution:
> if N = 1 , Possible way(1) = 1
> if N = 2 , Possible way(2) = (1,1) (2)
> if N = 3 , Possible way(3) = (1,1,1) (2,1) (1,2)
> if N = 4 , Possible way(5) = (1,1,1,1)(2,1,1) (1,2,1) (1,1,2) (2,2)
> if N = 5 , Possible way(8) = (1,1,1,1,1) (2,1,1,1)(1,2,1,1) (1,1,2,1) (1,1,1,2) (2,2,1) (2,1,2) (1,2,2)
Answer:
No Discussion on this question yet!
No Discussion on this question yet!