Dynamic Programming Homework - Task 1