int maxArea(vector<int>& height) {
int i=0,j=height.size()-1;
int ans=0;
while(i<j){
int mins=min(height[i],height[j]);
ans=max(ans,(j-i)*mins);
while(height[i]<=mins && i<j)
i++;
while(height[j]<=mins && i<j)
j--;
}
return ans;
}