Dynamic programming is tricky. Here’s my attempt at visualizing the thought process. Underlying code, live examples, and full walkthrough available in this Observable Notebook.
Pictured above is a directed acyclic graph that shows the possible paths for making change for $0.07 using quarters, dimes, nickels, and pennies.