Available question text
Maintain a sliding window of the last m stream elements and, after discarding the smallest k and largest k values, return the integer average of the remaining elements (return -1 if fewer than m elements). The core challenge is to support addElement and calculateMKAverage efficiently by keeping ordered partitions and their sums (e.g., via balanced BSTs/multisets or heaps with counts).
Related questions
Continue with questions that share topics or the same question type.
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 · 2 records
Google
Leetcode 1825. Finding MK Average
Reported Jan 10, 2025 · 1 source report
MID_LEVEL
Source snapshot: Nov 12, 2026
View sourceMeta
Leetcode 1825. Finding MK Average
Reported Mar 15, 2026 · 1 source report
SENIOR
Source snapshot: Nov 12, 2026
View source