implemented dynamic programming solution for knapsack.Solver