This animation shows how we can use dynamic programming to find the minimum number of coins needed to make a specific amount of change. We're using coins with values [1, 3, 4] and trying to make a total of 6.
Each cell in the table represents the minimum number of coins needed to make that amount. We fill the table step by step, and arrows show which coin was last used to achieve the minimum.
We'll start by initializing our DP table. Click "Next Step" to begin the animation.