Based on the book Programming Challenges by Steven S. Skiena and Miguel Revilla