Shortest Path With Obstacles, Learn grid traversal with state tracking.