Solution to the Algorithm I Week 3 assignment on Coursera.