Categorygithub.com/awesee/leetcodeproblemsmoving-average-from-data-stream
package
1.6.6
Repository: https://github.com/awesee/leetcode.git
Documentation: pkg.go.dev

# README

< Previous                  Next >

346. Moving Average from Data Stream (Easy)

Given a stream of integers and a window size, calculate the moving average of all integers in the sliding window.

Example:

MovingAverage m = new MovingAverage(3);
m.next(1) = 1
m.next(10) = (1 + 10) / 2
m.next(3) = (1 + 10 + 3) / 3
m.next(5) = (10 + 3 + 5) / 3

 

Related Topics

[Design] [Queue] [Array] [Data Stream]