Find Contiguous Subarray with Largest Min Plus Max -- Not OA but an INTERVIEW Question! :)
Problem Overview
- Find a contiguous subarray (more than one element) that maximizes minimum + maximum.
- Input: array of n positive integers; Output: largest value of min+max over any such subarray.
- Must run faster than O(n^3); framed as an efficiency-focused interview question.
- Relevant to array analytics and sliding-window style metrics.
- Google interviews; classic coding interview problem.
Example
Unlock to view complete problem details
and practice with sample input/output
Was this article helpful?
View Test Cases & Run Code requires membership
Input Variables
Execution Result:
