Solutions to Hacker Rank programming problems