Search
⌘K

Leetcode 1196. How Many Apples Can You Put into the Basket

Given an array apples where apples[i] is the number of apples on the i-th tree and each apple weighs 1 gram with a fixed basket capacity of 5000 grams, return the maximum number of apples you can put in the basket (i.e., min(total apples, 5000)).


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.