There is a stair with N step. You can jump either 1 step or 2 steps at time. How many different ways do you want to reach the top?
Solution
N = 1 --> 1
N = 2 ,, 1s+1s, 2s -> 2
N = 3 , 1s+1s+1s, 2s+1s, 1s+2s -> 3
N = 4, 1s+1s+1s+1s, 1s+1s+2s, 1s+2s+1s, 2s+1s+1s, 2s+2s -> 5
N = 5, 1s+1s+1s+1s+1s, 1s+1s+1s+2s, 1s+1s+2s+1s, 1s+2s+1s+1s, 2s+1s+1s+1s, 1s+2s+2s, 2s+1s+2s, 2s+2s+1s = 8
so and why?
Tumblr's Adult Fare Accounts For 11.4% Of Site's Top 200K Domains, Adult
Sites Are Leading Category Of Referrals
-
[image: bed-black-black-and-white-cig-cigarette-cigarettes-Favim.com-87776]How
much of Tumblr is porn, and what is Yahoo going to do about it? On the
latte...
6 minutes ago
I got this one during the interview, and I must say the answer is rather surprising.
ReplyDeleteThanks for the good blog,
Lukasz.
Fibonacci series...
ReplyDeleteFor explanation read http://tech-queries.blogspot.com/2011/07/fit-12-dominos-in-2n-strip.html