You have a ladder of N steps (rungs). You can go up the ladder by taking either 1 step or two steps at a time, in any combination. How many different routes are there (combinations of 1 steps or 2 steps) to make it up the ladder?
Anonymous
You don't need to be familiar with the Fibonacci series. Simply test the first few cases manually and you can deduce that there's a pattern. A ladder with 2 rungs (that is, the floor, rung #1 and rung#2): 2 ways to climb. 1+1, 2. A ladder with 3 rungs: 3 ways to climb. 1+1+1, 1+2, 2+1. A ladder with 4 rungs: 5 ways to climb. Think of it as climbing 1 rung and then you're at a 3-rung ladder (3 ways to climb) or climbing 2 rungs and then you're at a 2 rungs ladder (2 ways to climb). Overall you have 3+2 ways. A ladder with 5 rungs: like the previous case, you climb 1 and reach a 4-rungs ladder, or climb 2 and reach a 3-rungs ladder. overall 5+3, or 8 ways. .. .. .. A ladder with N rungs: sum of climbing (N-1) ladder and climbing (N-2) ladder: Ways(N) = Ways(N-1) + Ways (N-2). this can be solved with recursion or brute force.
Check out your Company Bowl for anonymous work chats.