Second assignment for Coursera Algorithm II class