Programming exercises from hackerrank.com