Algs week 1 programming task