3 × 4 grid · dp = #paths to here
·
·
·
·
·
·
·
·
·
·
·
·
Grid DP (tabulation)
▸1dp = R × C grid2fill top row and left column with 13for i in 1..R−1: for j in 1..C−1:4 dp[i][j] = dp[i−1][j] + dp[i][j−1]56return dp[R−1][C−1]
state
- grid3×4
- statedp[i][j] = #paths to (i,j)