Practice
/

Candy

Candy

Given an array of children's ratings, distribute the minimum number of candies such that each child gets at least one and children with higher ratings get more candies than their neighbors.

Premium Content

Create a free account, then unlock this problem and the entire premium catalog with a one-time CodeSnatch Premium purchase.

Already have an account with premium access? Sign in to continue.