Thoughtworks Interview Question

A knapsack problem