I need bit clarification in understanding the sample input’s output
why it’s 2.
5 2
0 0 0 1 0
we can reach up to 5th stair in 3 ways
1 1 1 2 [1->2->3->5]
1 2 2 [1->3->5]
2 1 2 [2->3->5]
I need bit clarification in understanding the sample input’s output
why it’s 2.
5 2
0 0 0 1 0
we can reach up to 5th stair in 3 ways
1 1 1 2 [1->2->3->5]
1 2 2 [1->3->5]
2 1 2 [2->3->5]
from 0 can’t he directly move to 2 ?
Because maximum move is 2 or is it like first step should be 1 only ?
there is not any 0 point you are standing at cell 1 and have to start walking from here
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.