```
class Solution {
public:
int maxArea(vector<int>& height) {
int result=0,tempResult=0,left=0;
int right=height.size()-1;
while(left<right){
//u should notice that the position of ++ and --
//你应该注意++ 和-- 的位置
tempResult=height[left]<height[right]?height[left]*(right-(left++)):height[right]*((right--)-left);
result=result>tempResult?result:tempResult;
}
return result;
}
};
```