双指针
const maxArea = function(height) {
let start = 0;
let end = height.length - 1;
let res = 0;
while(start < end) {
const area = Math.min(height[start], height[end]) * (end - start);
res = Math.max(area, res);
height[start] > height[end] ? end-- : start++;
}
return res;
};