param { number [ ] } height return { number } var maxArea = function ( height ) : number { let result = 0 ; let left = 0 ; let right = height . length - 1 ; while ( left < right ) { let side = Math . min ( height [ left ] , height [ right ] ) ; let len = right - left ; let volume = side * len ; result = volume > result ? volume : result ; if ( height [ left ] < height [ right ] ) { left ++ ; } else { right -- ; } } return result ; } ; export { maxArea } ;