盛最多水的容器
class Solution {
public:
int maxArea(vector<int>& height) {
if(height.size()==0) return 0;
int left=0,right=height.size()-1;
int res=INT_MIN;
while(left<right){
if(height[left]<height[right]){
res=max(res,height[left]*(right-left));
left+=1;
}
else{
res=max(res,height[right]*(right-left));
right-=1;
}
}
return res;
}
};