2D / Grid DP pattern
The state is usually dp[row, column]. Decide which earlier cells can move into it, then combine their saved answers.
Difficulty: Hard · Approach: Save each smaller answer once
This is a public lesson preview. Sign in with a Lifetime Pass to open the protected animation, solution, and code.