var maxArea = function (height) { let len = height.length if (len <= 1) return0 let result = 0, i = 0, j = len - 1 while (i < j) { let sum = Math.min(height[i], height[j]) * (j - i) result = Math.max(result, sum) if (height[i] < height[j]) { i++ } else { j-- } } return result }