func (ma *MovingAverage) Add(number int) {
	ma.sum += number
	ma.queue.Enqueue(number)
	if ma.queue.Size() <= ma.windowSize {
		return
	}

	value, _ := ma.queue.Dequeue()
	ma.sum -= value
}
// Add adds a number to the moving average calculations
Add adds a number to the moving average calculations
// Add adds a number to the moving average calculations
func (ma *MovingAverage) Add(number int) {
	ma.sum += number
	ma.queue.Enqueue(number)
	if ma.queue.Size() <= ma.windowSize {
		return
	}
	value, _ := ma.queue.Dequeue()
	ma.sum -= value
}
func ( ma * MovingAverage ) Add ( number int ) { ma . sum += number ma . queue . Enqueue ( number ) if ma . queue . Size ( ) <= ma . windowSize { return } value , _ := ma . queue . Dequeue ( ) ma . sum -= value }
Add adds a number to the moving average calculations
Add adds a number to the moving average calculations