Dynamic Programming21 sections · 916 units
Open in Course

Grid 1 - Understanding the Grid

The setup

The grid has rows of cells where '.' means empty and '#' means wall. You start at the top-left, end at the bottom-right. Walls block your path completely.

This is different from Red Green Towers. There, you tracked "which level" and "how many red blocks used." Here, you track "which row" and "which column." Both are 22D DP, but the dimensions mean completely different things. Your state is now a position on the grid, not a count of items used.