Given a stream of integers and a window size, calculate the moving average of all integers in the sliding window.
For example,
1 | MovingAverage m = new MovingAverage(3); |
1 | public class MovingAverage { |
Given a stream of integers and a window size, calculate the moving average of all integers in the sliding window.
For example,
1 | MovingAverage m = new MovingAverage(3); |
1 | public class MovingAverage { |