Stanford CS106B Assignment 3 Solution (Recursion)