Dynamic Programming, Programming, Algorithms, Data, Coding Interviews.
need only N step to reach the bottom out of those (N+M) steps, the paths differ from each other in the choice of the N downward movement out of the (N+M) possibilities. So, the total number of paths can be obtained as the number of ways to choose N out of (N+M) different things, that is, as C(M+N,