the basic idea is to traverse the list, updating the result and keep moving the lower line.

```
class Solution {
public:
int maxArea(vector<int> &height) {
int i=0,j=height.size()-1,result = 0;
while(i<j){
result = height[i]>=height[j] ? max(result,(j-i)*height[j--]) : max(result, (j-i)*height[i++]);
}
return result;
}
};
```