Solve the knapsack problem using dynamic programming.
HardProblem Statement
Solve the knapsack problem using dynamic programming.
Sample Input
Weights: [1, 3, 4, 5]; Values: [1, 4, 5, 7]; Capacity: 7
Sample Output
Maximum Value: 9
Limits
Time: 2s · Memory: 256 MB