You walk up 12 steps going up either 1 or 2 levels with each
You walk up 12 steps, going up either 1 or 2 levels with each stride. There is a snake on the 8th step, so you cannot step there. How many ways can you go up? For example, one way is 1-1-1-1-1-1-1-2-1-1-1, while another is 2-2-2-1-2-2-1.
Solution
one way is we go 1 step each till 7th that is 7C7 = 1
2nd is we go 1-3-5-7 alternate steps till 7th that is 4C3 = 4
another is we take either 1 step then 2 or first 2 then 1 so it will cover 6 steps and then 1 last 7th so that is = 6C1 = 6
and one more is that we take first 5 steps or last five steps and remaining two one by one So that is 5C2 = 10
So total is 1+4+6+10 = 21
but
also it says
each stride will cover 1 or 2 levels
it means answer times 3 strides
so
3*21 = 63
