algs4; exercise 1.1.7 - fix based on errata