Dynamic Programming, Programming, Algorithms, Data, Coding Interviews.
then only we can reach the last cell. For example, we can reach the last cell if we go RRDRDRDDRD…….up to N D’s and M R’s (here R represents right and D down). The problem can be solved by simple combinatorics. Basically, every path is made up of N downward movement and M rightward movement. As we