...

/

Solved Problem - Sliding Window Maximum

Solved Problem - Sliding Window Maximum

Problem Statement

Given an array AA, of NN integers. Print the maximum integer in that subarray for all subarrays of length KK.

Input format

The first line contains two space-separated integers NN and KK (1KN105)(1 \leq K \leq N \leq 10^5). The second line contains NN space separated integers representing the array A[]A[] ...