Thoughtworks Interview Question

Knapsack problem