双指针法
class Solution {
public int maxArea(int[] height) {
//双指针
int i = 0;
int j = height.length -1;
int res = 0;
while(i<j){
res = height[i]<height[j]? Math.max(res,(j-i) * height[i++]):
Math.max(res,(j-i) * height[j--]);
}
return res;
}
}