Dynamic Programming, Programming, Algorithms, Data, Coding Interviews.
pathCount(N-1,M)+pathCount(N,M-1) As we can observe, the total number of paths can be large in numbers. If we design a recursive solution, a lot of sub-problems will be repeated and we can apply a dynamic programming strategy. Other examples of counting problems Count ways to make the change Count