In many problems dealing with an array (or a LinkedList), we are asked to find or calculate something among all the contiguous subarrays (or sublists) of a given size.
Sliding window come in aid. Brute-force will require complexity of O(n*K) while sliding window will cut it to O(N)