*There are N children standing in a line. Each child is assigned a rating value.
You are giving candies to these children subjected to the following requirements:
Each child must have at least one candy.
Children with a higher rating get more candies than their neighbors.*

Here the rating is passed as a parameter to the function.

But where is the information about children having the candies?

I am referring to this particular line

*Each child must have at least one candy.*

How do we decide which child has how many candies initially?