Problem Set 04: Dynamic Programming part 2