8.2 Robot in a Grid: Imagine a robot sitting on the upper left corner of grid with r rows and c columns. The robot can only move in two directions, right and down, but certain cells are "off limits" such that the robot cannot step on them. Design an algorithm to find a path for the robot from the top left to the bottom right.
First I am going to try and solve this problem without the assumed constraint (of begin only able to move right down).
My approach was to have the program follow a stack of operations that always have a priority.
In particular, we know that moving towards the right and descending down will always allow us to get closer to our goal.
However, there are situations where we get 'trapped'. The solution here is to just mark said node as not valid. We know this to happen when we're already tried going right or down. So we mark the visited node as 'n' for null, for elements we move left or down.