Microsoft interview question

knapsack problem using dp algo