What's Wrong With My Code ? (Splitting Candies)

Code posting during contest not allowed .

Ok Sorry . I’ve forgotten that