Grid DP: ways to reach cell = from top + from left.
Use 1D DP per row:
dp[c] stores ways to reach current row, column c.
Update: dp[c] += dp[c-1].
Grid DP: ways to reach cell = from top + from left.
Use 1D DP per row:
dp[c] stores ways to reach current row, column c.
Update: dp[c] += dp[c-1].