My code from Udacity's 'Intro to Algorithms' course