Count the paths across a grid with walls, moving only right or down, or find the cheapest one: each cell from the cell above and the cell to its left, then the path traced back. A table of R × C cells against plain recursion that solves a cell once for every path from it to the target.
This interactive visualization needs JavaScript.