Added dynamic programming solver.