class Solution {
public:
int maxArea(vector<int> &height) {
// Start typing your C/C++ solution below
// DO NOT write int main() function
int width = height.size();
int max = 0;
int left = 0,right = width-1;
while(left<right)
{
width = min(height[left],height[right]);
width = width *(right -left);
if(width>max)
max = width;
if(height[left] > height[right])
right--;
else
left++;
}
return max;
}
};