Solving hackerRank problems