solved Candies from HackerRank