给一个数组的高度a1,a2,...,an, 垂直线 i 的两个端点 (i, 0)和(i, ai),
Github地址 LeetCode-11 盛最多水的容器:https://github.com/JacobLei/leetcode/blob/master/src/main/java/A11_ContainerWithMostWater.java
给你 n 个非负整数 a1,a2,…,an,每个数代表坐标中的一个点 (i, ai) 。在坐标内画 n 条垂直线,垂直线 i 的两个端点分别为 (i, ai) 和 (i, 0) 。找出其中的两条线,使得它们与 x 轴共同构成的容器可以容纳最多的水。
Leetcode-11 盛最多水的容器 原题链接 https://leetcode-cn.com/problems/container-with-most-water/ func maxArea(height
昨天的题解 题目 每天一道leetcode-11盛最多水的容器 分类:双指针 中文链接: https://leetcode-cn.com/problems/container-with-most-water