My code for the HackerRank competition several days ago.