Salesforce interview question

Dynamic programming. Knapsack problem.