algorithm 1 assignment on Coursera