Coursera algorithm