Learn
Practice
Newsletter
Resources
F
Toggle theme
0
F
Toggle theme
0
Toggle menu
← Back to All Animations
Apple Redistribution into Boxes
Bookmark
Input
Example 1
Example 2
Single apple pack
Fewer boxes
Custom
apple
=
[1, 3, 2]
,
capacity
=
[4, 3, 1, 5, 2]
totalApples = ?
currentCapacity = 0
apple
0
1
1
3
2
2
capacity (sorted desc)
0
4
1
3
2
1
3
5
4
2
algo
master
.
io
Step:
Start: Find minimum number of boxes to redistribute all apples
0 / 10
Input
Example 1
Example 2
Single apple pack
Fewer boxes
Custom
apple
=
[1, 3, 2]
,
capacity
=
[4, 3, 1, 5, 2]
0 / 10
totalApples = ?
currentCapacity = 0
apple
0
1
1
3
2
2
capacity (sorted desc)
0
4
1
3
2
1
3
5
4
2
algo
master
.
io
Step:
Start: Find minimum number of boxes to redistribute all apples