
/**
* @param {number[]} height
* @return {number}
*/
var maxArea = function(height) {
let max=0;
for(let i=0,j=height.length-1;i<j;){
const minHeight=height[i]<height[j]?height[i++]:height[j--];
const area=(j-i+1)*minHeight;
max=Math.max(max,area);
}
return max;
};

博客围绕LeetCode算法展开,虽未给出具体内容,但推测会涉及算法知识、解题思路等信息技术领域内容,对职场发展或有一定帮助。
1724

被折叠的 条评论
为什么被折叠?



