Challenge Information

Title : Max from Subarray
Difficulty : Medium
Solutions : 5
Maximum Score : 100
Completed by You: No
Description :

An array and integer X is given to determine the maximum for each contiguous subarray of size X.

Write a function solve that have the following parameter(s):
1.) = integer
2.) arr = an array of integer

Example
Input:
There is an integer and array of integers given:
a = 3
arr = [4, 5, 6, 1, 3, 6]
Output:
The function will return,
[6, 6, 6, 6]

Explanation
1st contiguous subarray = {4, 5, 6} Max = 6
2nd contiguous subarray = {5, 6, 1} Max = 6
3rd contiguous subarray = {6, 1, 3} Max = 6
4th contiguous subarray = {1, 3, 6} Max = 6

Constraints


Judocode