Available question text
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.
Related questions
Continue with questions that share topics or the same question type.
- Minimum Cost to Balance a Circular Array of Warehouses
Coding
- Minimum Insertions to Balance a Parentheses String
Coding · Bracket Sequences · Greedy · Stack
- Minimum Removals to Balance Array
Coding · Array · Binary Search · Sliding Window
- Account Balance
Coding
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 3679. Minimum Discards to Balance Inventory
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source