[Coursera][Algorithms] assignment for week 4