Coursera: Algorithm, assignments 2. Refined the code to meet the test.