Candies | HackerRank

Help Alice to save money by minimizing the total number of candies.