Math Fundamentals18 sections · 814 units
Open in Course

Grid-Based Problems

(Cells and coordinates)

Many problems involve grids where each cell is a unit square. Cell (i, j) represents row i, column j. Movement is typically limited to four directions: up, down, left, right.

Distance in grids usually means Manhattan distance. Area is the count of cells. Perimeter is the count of exposed edges.

Grid problems often combine geometry with graph traversal (BFS, DFS). The geometry part is recognizing positions as coordinates.