kailangan ng subscription para mapanood ang video na ito.

Leetcode 346. Moving Average from Data Stream - Python

208 Mga view
ram256
ram256
09/10/24

346. Moving Average from Data Stream

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.

Connect with me on Linkedin! https://www.linkedin.com/in/helmy47/

Magpakita ng higit pa

0 Mga komento Pagbukud-bukurin Ayon

Walang nakitang komento

Susunod