Code from HackerRank challenges.