Solution to the 0-1 Knapsack problem using dynamic programming.