Ezvor

1196. How Many Apples Can You Put into the Basket

EasyArray Preparing judge… LeetCode
ArrayGreedySorting

Hints

Hint 1
What if you think in a greedy approach?
Hint 2
The best apple to take in one step is the one with the smallest weight.
Hint 3
Sort the array and take apples with smaller weight first.