Search
⌘K

Leetcode 1815. Maximum Number of Groups Getting Fresh Donuts

Given batchSize and group sizes, maximize how many groups can start with a fresh batch by reordering groups; the core challenge is to treat group sizes by their remainder mod batchSize and use a DP/memoization over the multiset of remainders (encoded compactly) to optimally sequence them (batchSize ≤ 9, groups ≤ 30).


Question Timeline

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

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