-
Notifications
You must be signed in to change notification settings - Fork 1
Dynamic Programming
Andrew Shepherd edited this page Nov 20, 2025
·
2 revisions
If you can distil a problem down into a grid of numbers, where each number can be calculated from the number above and the number to the left, then that's a dynamic programming problem.
Once you've managed to reduce the problem to this, it's usually quite easy from there. But coming up with the grid can be really tricky, and usually involves some AHA! moment.
- 2463. Minimum Total Distance Travelled
- 3743. Maximize Cyclic Partition Score In this one each layer of the dp is not a one dimensional array but a two dimensional grid.