Container With Most Water
Given an array height where each element is a vertical line's height, find two lines that, with the x-axis, hold the most water. Return that maximum area. Area between lines i and j is min(height[i], height[j]) * (j - i).
The O(n) answer is two pointers from both ends: always move the shorter line inward (moving the taller one can never help).
maxArea([1, 8, 6, 2, 5, 4, 8, 3, 7]); // 49
maxArea([1, 1]); // 1