diff --git a/queues/moving_average.py b/queues/moving_average.py index 23b260f..292ae7a 100644 --- a/queues/moving_average.py +++ b/queues/moving_average.py @@ -3,17 +3,13 @@ # author: bt3gl ''' -Given a stream of integers and a window size, calculate the moving average of all integers in the sliding window. - -Implement the MovingAverage class: - -MovingAverage(int size) Initializes the object with the size of the window size. -double next(int val) Returns the moving average of the last size values of the stream. +Given a stream of integers and a window size, calculate the moving average in the sliding window. ''' class MovingAverage: def __init__(self, size: int): + self.queue = [] self.size = size