Step 1: Initialize dp array with 0 for amount 0 and infinity for others
dp: [0, ∞, ∞, ∞, ∞, ∞, ∞]
Why: We know 0 coins are needed to make amount 0; others unknown yet
Step 2: Calculate dp[1]: check coins 1,3,4; only coin 1 fits
dp: [0, 1, ∞, ∞, ∞, ∞, ∞]
Why: To make amount 1, use coin 1 plus dp[0]=0 coins
Step 3: Calculate dp[2]: check coins 1,3,4; only coin 1 fits
dp: [0, 1, 2, ∞, ∞, ∞, ∞]
Why: To make amount 2, use coin 1 plus dp[1]=1 coin
Step 4: Calculate dp[3]: check coins 1,3,4; coins 1 and 3 fit
dp: [0, 1, 2, 1, ∞, ∞, ∞]
Why: Coin 3 fits exactly, so dp[3]=1 coin is better than dp[2]+1=3
Step 5: Calculate dp[4]: check coins 1,3,4; all fit
dp: [0, 1, 2, 1, 1, ∞, ∞]
Why: Coin 4 fits exactly, so dp[4]=1 coin
Step 6: Calculate dp[5]: check coins 1,3,4; all fit
dp: [0, 1, 2, 1, 1, 2, ∞]
Why: Best is coin 1 + dp[4]=1+1=2 coins
Step 7: Calculate dp[6]: check coins 1,3,4; all fit
dp: [0, 1, 2, 1, 1, 2, 2]
Why: Best is coin 3 + dp[3]=1+1=2 coins
Result: dp: [0, 1, 2, 1, 1, 2, 2]
Minimum coins to make 6 is 2