Skip to content

Latest commit

 

History

History
43 lines (25 loc) · 669 Bytes

File metadata and controls

43 lines (25 loc) · 669 Bytes

中文文档

Description

Given a stream of integers and a window size, calculate the moving average of all integers in the sliding window.

Example:

MovingAverage m = new MovingAverage(3);
m.next(1) = 1
m.next(10) = (1 + 10) / 2
m.next(3) = (1 + 10 + 3) / 3
m.next(5) = (10 + 3 + 5) / 3

 

Solutions

Python3

Java

...