Dynamic Programming, Programming, Algorithms, Data, Coding Interviews.
N) = (M + N)!/(N!)(M!). We can also think in another way! We can reach the right end using M steps, out of (N+M) steps. So, the total number of paths can be obtained as the number of ways to choose M out of (N+M) different things, that is, as C(M+N, M) = (M + N)!/(N!)(M!). In both cases, the answer