Solution to Robot Problem
Well, I should admit that I’m not a genius to have figured the method at the first glance but I’ve spent enough time trying few brute force methods to arrive at the solution. After trying few methods to solve the problem I stumbled on this approach which actually solved the problem.
I approached the problem using the Dynamic Programming methodology. The method is not very complex neither it uses any Permutation and Combinations to compute the different ways of reaching the target node. Say, you’ve 3 x 3 matrix and you number each cell from left-to-right and the goal is reach from Cell 1 (1,1) to Cell 9 (3, 3) (read robot problem on problem statement). You can see that there are only 6 ways to reach Cell numbered 9. Now expanding the same to 4 x 3 matrix’s you can see that there are only 10 different ways to reach the target node. See demonstration diagrams for better understanding.


