注册一亩三分地论坛,查看更多干货!
您需要 登录 才可以下载或查看附件。没有帐号?注册账号 
x
uber onsite for sanfransisco
We define a subarray of size m in an n-element array to be the contiguous block of elements in the inclusive range from index i to index j, where j − i + 1 = m and 0 ≤ i ≤ j < n. For example , given array [8, 2, 4], the subarrays of size m = 2 would be [8, 2] and [2, 4] (but not [8, 4] since these elements aren't contiguous).
Given an array of integers arts:
1 ≤ arr.length ≤ 3 105,
1 ≤ arr[i] ≤ 109.
* [input] integer m
An integer representing the size of the subarrays to consider.
Guaranteed constraints:
1 ≤ m ≤ arr.length.
* [output] integer
The maximum value among the minimum values of all subarrays of size m.
|