Solution to the Week 2 programming assignment of Algorithm I course on Coursera.