Given an array, find the average of all contiguous subarrays of size ‘n’ in it.
Array: [1, 3, 2, 6, -1, 4, 1, 8, 2], n=5
Output: [2.2, 2.8, 2.4, 3.6, 2.8]
Solution:
Sliding Window algorithm can be used to resolve this.
Time Complexity:
O(n)
Space Complexity:
O(1)
![How to generate DDL(create statement) with columns using Python[code snippets]](https://www.24tutorials.com/wp-content/uploads/2018/06/20180612_115101_0001-224x110.png)