Candy
Children sit in a line with ratings. Each child must have at least one candy, and higher-rated children must receive more than their immediate neighbors. Return the minimum total candies needed.
Children sit in a line with ratings. Each child must have at least one candy, and higher-rated children must receive more than their immediate neighbors. Return the minimum total candies needed.