Solutions to HackeRank problems