```
class Solution {
public:
int maxArea(vector<int>& height) {
int i = 0, j = height.size()-1;
int res = 0;
while(i < j){
int h = min(height[i], height[j]);
res = max(res, h*(j - i));
//The reason why it is j - i rather than j - i + 1: because we are using the blanks to calculate the volumn rather than the points!
while(i < j && height[i] <= h) i++;
while(i < j && height[j] <= h) j--;
}
return res;
}
};
```