Dynamic Programming: Minimum Cost

Problem Statement:

We have weights from 1 to 10, and each weight has an associated cost:

Weight 1 2 3 4 5 6 7 8 9 10
Cost 1 5 8 9 10 17 17 20 24 30

The goal is to find the minimum cost to achieve a target weight of 10, by combining smaller weights.

Initializing DP array: dp[0] = 0 (cost to achieve weight 0 is 0)