There are n children standing in a line. Each child is assigned a rating value given in the integer array ratings.
You are giving candies to these children subjected to the following requirements:
Return the minimum number of candies you need to have to distribute the candies to the children.
n == ratings.length1 <= n <= 2 * 10^40 <= ratings[i] <= 2 * 10^4ratings = [1,0,2]5ratings = [1,2,2]4