Independence Day Sale! Unlock 40% OFF on All Job-Oriented Training Programs – Limited Time Only! Offer Ending in
D
H
M
S
Get Now
Problem Submissions Solution

Max of min for every window

Difficulty: Hard

Acceptance: %

Points: 40.00

Given an array of integers arr[], the task is to find the maximum of the minimum values for every possible window size in the array, where the window size ranges from 1 to arr.size().


More formally, for each window size k, determine the smallest element in all windows of size k, and then find the largest value among these minimums where 1<=k<=arr.size().

Topics

Companies

Articles

Examples:

NA

Constraints:
  • 1 <= arr.size() <= 105
  • 1 <= arr[i] <= 106
Companies:
Amazon Microsoft Flipkart
Topics:
Stack
Locked Content
Access Restricted: Please Login to access the code editor and test cases.