My solution to HackerRank exercises