Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 3679. Minimum Discards to Balance Inventory
Given a sequence of daily arrivals, a window size w, and a per-type cap m, compute the minimum number of arrivals that must be discarded (only on their arrival day) so that in every length-w window each item type appears at most m times. This is a sliding-window + frequency-counting problem: maintain per-type counts over the last w days and greedily discard any arrival that would push its type's count above m.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.