Interview Guides

Given a list of real numbers stream and an integer k, return a list where the ith value is the moving average of the last at most k elements seen so far. If fewer than k elements have been seen, average all available elements. The output should contain one average per incoming value in the stream.
1 <= len(stream) <= 10^51 <= k <= 10^5-10^6 <= stream[i] <= 10^6stream are real numbers