Given an integer array of size , find the maximum of the minimum(s) of every window size in the array. The window size varies from to .
For example, given , consider window sizes of through . Windows of size are . The maximum value of the minimum values of these windows is . Windows of size are and their minima are . The maximum of these values is . Continue this process through window size to finally consider the entire array. All of the answers are .
Complete the riddle function in the editor below. It must return an array of integers representing the maximum minimum value for each window size from to .
riddle has the following parameter(s):
arr: an array of integers
The first line contains a single integer, , the size of .
The second line contains space-separated integers, each an .
Single line containing space-separated integers denoting the output for each window size from to .