Solved Candy Problem