Source: https://www.cs.cornell.edu/courses/cs1110/2016sp/lectures/03-17-16/13A.ListsOfNumbers.pdf