There are N stairs counting from 1...N with N being the highest stair. A ball is kept at stair N. Find no. of ways in which ball can reach ground. Conditions:
Ball can overshoot and reach ground. Means if the ball is at last stair 1 and at odd attempt then it can reach ground in 3 ways(1,2,3 steps). Similar for even attempt also.
Eg.
N = 3
Sticky stair = 2
---+
3|
|
+----+
2|
|
+----+
1|
|
+-------------------
No. of ways = 4
3->G
3->1->G (1 step from 1)
3->1->G (3 step from 1)
3->1->G (4 step from 1)