subtract the element at index i - k - 1 and add the element at index i - i from the sum ( sum contains the sum of previous ' K ' elements )
Array [ i ] = sm - Array [ i - K - 1 ] + Array [ i - 1 ] NEW_LINE