Learn
Practice
Newsletter
Resources
F
Toggle theme
0
F
Toggle theme
0
Toggle menu
← Back to All Animations
Candy
Bookmark
Input
Example 1
Example 2
Mountain
Descending
Ascending
Custom
ratings
=
[1, 0, 2]
ratings
0
1
1
0
2
2
candies
1
1
1
algo
master
.
io
Step:
Start: Distribute minimum candies based on ratings
Variable
Value
ratings
[1,0,2]
candies
-
i
-
Variable
Value
total
-
return
-
0 / 11
Input
Example 1
Example 2
Mountain
Descending
Ascending
Custom
ratings
=
[1, 0, 2]
0 / 11
ratings
0
1
1
0
2
2
candies
1
1
1
algo
master
.
io
Step:
Start: Distribute minimum candies based on ratings
Visualization
Variables