Three things to remember:
Grid DP uses position as state. means "answer for cell ." No resource tracking, just location.
Transitions come from neighbors. Movement constraints define your transitions.
Obstacles set dp to 0. Walls break paths. You now have two 2D (two-dimensional) patterns: resource tracking (Red Green Towers) and grid navigation (Grid 1). Apply these patterns when you encounter similar problems.