Given an array of sensor readings, write a function to find the moving average while minimizing computational overhead.
Implement moving_average(readings, window_size). Return a list containing the average of every contiguous window of window_size, in order. Use an incremental update so each new reading is added and the outgoing reading is removed rather than recomputing each window from scratch.
readings is a non-empty list of numbers, and window_size is between 1 and the number of readings.
def moving_average(readings, window_size):