Step 1: Initialize dp array with dp[0] = 0 and others as large number
dp = [0, ∞, ∞, ∞, ∞, ∞, ∞]
Why: 0 coins 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, ∞, ∞, ∞, ∞, ∞]
Step 3: Calculate dp[2]: check coins 1, 3, 4; only coin 1 fits
dp = [0, 1, 2, ∞, ∞, ∞, ∞]
Step 4: Calculate dp[3]: check coins 1, 3, 4; coin 3 fits with dp[0]
dp = [0, 1, 2, 1, ∞, ∞, ∞]
Why: 3 = 1 coin of 3 (better than 3 coins of 1)
Step 5: Calculate dp[4]: check coins 1, 3, 4; coin 4 fits with dp[0]
dp = [0, 1, 2, 1, 1, ∞, ∞]
Why: 4 = 1 coin of 4 (better than dp[3]+1=2)
Step 6: Calculate dp[5]: check coins 1, 3, 4; coin 1 fits with dp[4], coin 3 fits with dp[2], coin 4 fits with dp[1]
dp = [0, 1, 2, 1, 1, 2, ∞]
Why: 5 = min(dp[4]+1=2, dp[2]+1=3, dp[1]+1=2) = 2
Step 7: Calculate dp[6]: check coins 1, 3, 4; coin 1 fits with dp[5], coin 3 fits with dp[3], coin 4 fits with dp[2]
dp = [0, 1, 2, 1, 1, 2, 2]
Why: 6 = min(dp[5]+1=3, dp[3]+1=2, dp[2]+1=3) = 2
Result: dp array: [0, 1, 2, 1, 1, 2, 2]
Minimum coins to make 6 = 2