Coursera: Algorithm: assignments 2