Thoughtworks interview question

Knapsack problem