int maxArea(int* height, int heightSize)
{
int max=0,h=0;
int left=0,right=heightSize-1;
while(left<right)
{
//无论左边指针还是右边指针移动,底的值都会减1,所有要把两边高中高的高留下了
int h=height[right]>height[left]?height[left]:height[right];
if((right-left)*h>max)
max=(right-left)*h;
if(height[right]>height[left])
left++;
else
right--;
}
return max;
}