Leetcode 11 Container With Most Water
class Solution{
public:
int maxArea(vector<int>& height){
int left = 0;
int right = height.size()-1;
int max_area = 0;
while(right > left){
max_area = max(max_area,min(height[left],height[right]) * (right - left));
if(height[right] > height[left])
left ++;
else
right --;
}
return max_area;
}
};