Description
Given a stream of integers and a window size, calculate the moving average of all integers in the sliding window.
Example:
1 | MovingAverage m = new MovingAverage(3); |
Solution
1 | class MovingAverage { |
Why don't you come to your senses?
Given a stream of integers and a window size, calculate the moving average of all integers in the sliding window.
Example:
1 | MovingAverage m = new MovingAverage(3); |
1 | class MovingAverage { |