Easy

This question is a daily question and will count towards your daily streak.

You are building a real-time stock price tracker. The goal is to calculate the moving average of the last n prices whenever a new price is added. The function updatePrices takes a list of prices and a window size n. Which implementation correctly calculates the moving average?

Choose an option below