内缩较短板一侧
public int maxArea(int[] height) {
int max = 0;
for (int left = 0,right = height.length - 1; left < right;) {
max = Math.max(max,Math.min(height[left],height[right])
* (right - left));
//内缩短板
if (height[left] < height[right]) {
left++;
continue;
} else {
right--;
}
}
return max;
}