Learn
Practice
Newsletter
Resources
F
Toggle theme
0
F
Toggle theme
0
Toggle menu
← Back to All Animations
Fair Distribution of Cookies
Bookmark
Input
Standard
Small
Simple
Custom
cookies
=
[8, 15, 10, 20, 8]
,
k
=
2
cookies:
0
8
1
15
2
10
3
20
4
8
Current child
Remaining
Not in mask
Distribute 5 bags among 2 children to minimize unfairness
algo
master
.
io
Step:
Start: distribute 5 cookie bags among 2 children
0 / 1123
Input
Standard
Small
Simple
Custom
cookies
=
[8, 15, 10, 20, 8]
,
k
=
2
0 / 1123
cookies:
0
8
1
15
2
10
3
20
4
8
Current child
Remaining
Not in mask
Distribute 5 bags among 2 children to minimize unfairness
algo
master
.
io
Step:
Start: distribute 5 cookie bags among 2 children