LeetCode11. 盛最多水的容器题解
题目链接:
https://leetcode.cn/problems/container-with-most-water
示例

思路
暴力解法
定住一个柱子不动,然后用其他柱子与其围住面积,取最大值。
代码如下:
public int maxArea1(int[] height) {
int n = height.length;
int ans = 0;
for (int i = 0; i < n; i++) {
<
LeetCode11盛水容器题解

最低0.47元/天 解锁文章
1716

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



