Micro1 interview question

For the coding exercise, you are asked to solve a knapsack problem.