Exercise 4: Greedy Problems and Dynamic Programming II