← 返回 atlassian 的题目列表Weighted Moving Average
类型:online_judge
Imagine you are part of the analytics team that tracks changing user trends. You’re tasked with calculating a moving average from a data stream with a window size of X. Now our engineers are interested in understanding the short-term impact certain changes are having on customers. Can you modify your approach to provide a Weighted Moving Average where more recent data points have higher weights? Can you do this without storing all previous data points?
Example
Input
10