Learn
Practice
Newsletter
Resources
Animations
New
F
Toggle theme
0
F
0
Toggle menu
← Back to All Animations
Candy
Bookmark
Input
Example 1
Example 2
Mountain
Descending
Ascending
Custom
ratings
=
[1, 0, 2]
ratings
candies
1
0
0
1
2
2
algo
master
.
io
Step:
Start: Hand out the fewest candies while respecting the ratings
0 / 7
Input
Example 1
Example 2
Mountain
Descending
Ascending
Custom
ratings
=
[1, 0, 2]
0 / 7
ratings
candies
1
0
0
1
2
2
algo
master
.
io
Step:
Start: Hand out the fewest candies while respecting the ratings