Solutions for HackerRank problems