Max Array
CodeChefOpen on judge ↗
Given an array of length n and an integer k, find the maximum for each and every contiguous subarray of size k. Input The length of the array. The next line contains the elements of the array separated by space The next line contains the k . Output Print the n-k+1 maximum values in an array separated by space. Constraints - n ≤ 1000000 - k ≤ 100000 - 0 ≤ a[i] ≤ 100000 Example Input: 9
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start