From af264699b76c54703e53b742c274ef8272aa1374 Mon Sep 17 00:00:00 2001 From: marina <138340846+bt3gl-cryptographer@users.noreply.github.com> Date: Mon, 7 Aug 2023 18:57:15 -0700 Subject: [PATCH] Update moving_average.py --- queues/moving_average.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) 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