https://leetcode-cn.com/problems/container-with-most-water/
class Solution {
public:
int maxArea(vector<int>& height) {
int left = 0;
int right = height.size() - 1;
int res = 0;
while(left < right) {
if(height[left] <= height[right]) {
int temp = height[left] * (right - left);
res = max(res, temp);
left++;
}else {
int temp = height[right] * (right - left);
res = max(res, temp);
right--;
}
}
return res;
}
};