LeetCode Container With Most Water
2014-08-28 11:32
453 查看
https://oj.leetcode.com/problems/container-with-most-water/
public int maxArea(int[] height) { int max = 0; int i = 0; int j = height.length - 1; while(i < j){ if(height[i] < height[j]) max = Math.max(max, (j - i) * height[i++]); else max = Math.max(max, (j - i) * height[j--]); } return max; }
相关文章推荐
- [leetcode]Container With Most Water
- 11. Container With Most Water LeetCode题解
- LeetCode:Container With Most Water
- LeetCode Container With Most Water 查找容水量最大的容器 动态规划法思想分析
- 11【Leetcode】 Container With Most Water
- LeetCode. Container With Most Water
- LeetCode-Container With Most Water
- LeetCode(11) ContainerWithMostWater
- leetcode-011:Container With Most Water
- [leetcode]Container With Most Water
- Leetcode Container With Most Water
- Leetcode 11 Container With Most Water
- 算法分析与设计——LeetCode Problem.11 Container With Most Water
- leetcode Container With Most Water
- [leetcode javascript解题]Container With Most Water
- leetcode - Container With Most Water
- LeetCode-11:Container With Most Water
- leetcode 11 Container With Most Water
- leetcode Container With Most Water
- LeetCode: Container With Most Water