Your mission
Given an integer array dataseries and a window size shift, compute the simple moving average over each contiguous window of length shift.
See it in action
sma([1, 2, 3, 4, 5, 6], 0)[]sma([1, 2, 3, 4, 5, 6], 1)[1.0, 2.0, 3.0, 4.0, 5.0, 6.0]sma([1, 2, 3, 4, 5, 6], 4)[2.5, 3.5, 4.5]sma([1, 2, 3, 4, 5, 6], 5)[3.0, 4.0]sma([], 1)[]sma([21], 1)[21.0]sma([1, 2, 3], 10)[]sum(sma(range(300, 401), 8))32900.0sum(sma(range(0, 2**21), 2))2199021158400.5sma([800, 741, 674, 1301], 3)[738.33, 905.33]
Your checklist
Constraints
- Expected file
simple_moving_average.py- Allowed functions
- None. Write every helper yourself.
