Fixed-Size Sliding Window with Average and Mode
Design a fixed-capacity data window of size k that supports:
add(x): add integerxto the window. If the window is full (already holdsknumbers), first evict the oldest number, then insert...
Example
Unlock to view complete problem details
and practice with sample input/output
Was this article helpful?
View Test Cases & Run Code requires membership
Standard Input
Execution Result:
