Algorithm · Oracle · Medium
Requirements Input: a nonnegative integer array height[]; the value height[i] gives the height of the vertical segment positioned at x-coordinate i. Output: return the greatest water-container area, computed as max over (i, j) of (j - i) * min(height[i], height[j]). Report only that maximum area; do not return the pair of positions. Preparation Work through LeetCode 11, "Container With Most Water," and be ready to explain in one paragraph why the shorter-side pointer must be…
Checking your access…