Learn
Practice
Newsletter
Resources
Animations
New
F
Toggle theme
0
F
0
Toggle menu
← Back to All Animations
Assign Cookies
Bookmark
Input
Example 1
Example 2
Unsorted input
All satisfied
None satisfied
Mixed
Custom
g
=
[1, 2, 3]
,
s
=
[1, 1]
g
greed
s
cookies
0
1
2
0
1
1
2
3
1
1
algo
master
.
io
Step:
Start: Assign cookies to maximize the number of content children
0 / 7
Input
Example 1
Example 2
Unsorted input
All satisfied
None satisfied
Mixed
Custom
g
=
[1, 2, 3]
,
s
=
[1, 1]
0 / 7
g
greed
s
cookies
0
1
2
0
1
1
2
3
1
1
algo
master
.
io
Step:
Start: Assign cookies to maximize the number of content children