Hi

When the question said children with higher rating get more candies than their neighbors, I assumed

that neighbor children with equal rating get equal candies

Case 1 (I agree with this)

Problem: [2, 2]

Solution: 2 Explanation: children are given [1,1] candies

Case 2 (Not clear)

Problem: [1, 2, 2]

Actual Solution: 5.

The children must be given [1, 2, 2] candies. The first one must get atleast 1. Which means the second one must get atleast 2.

So the third child is also given 1? So neighbor children with equal rating get unequal candies?

Is this not the case?

Thank you

Mukund