Minimum Path Sum
Signals to notice
Brute force first
Try all paths. Each cell branches into right and down. That direct path helps you understand the question, but it tends to treat every possibility as brand new instead of learning from earlier steps.
The key insight
DP: dp[i][j] = grid[i][j] + min(dp[i-1][j], dp[i][j-1]). Each cell's minimum cost comes from the cheaper of the cell above or to the left., and you can compress the memory down even further. Once you hold onto the right piece of information from moment to moment, the problem feels less like trial and error and more like following a shape that was there all along.
What must stay true
You can only arrive from above or the left. The minimum cost to reach (i,j) is its own cost plus the cheaper of the two possible predecessors. No other path can be cheaper. When you keep that truth intact, each local choice supports the larger solution instead of fighting it.
Easy way to go wrong
Not initializing the first row and column correctly — the first row can only come from the left, and the first column only from above. They have only one predecessor each. The fix is usually to return to the meaning of each move, not just the steps themselves.