11. Container With Most Water
2017-04-01 12:25
447 查看
变量唯一
public class Solution { public int maxArea(int[] height) { int n = height.length; int max_Area = 0; int left = 0; int right = n-1; while (left < right) { max_Area = Math.max(max_Area, Math.min(height[left], height[right]) * (right - left)); if(height[left] <= height[right]) ++left; else --right; } return max_Area; } }
相关文章推荐
- LeetCodeOJ_11_m_Container With Most Water
- leetcode 11:Container With Most Water
- 11. Container With Most Water
- Middle-题目31:11. Container With Most Water
- 11. 盛最多水的容器 Container With Most Water
- 11. Container With Most Water
- 刷LeetCode(11)——Container With Most Water
- LeetCode11:Container With Most Water
- [Leetcode 43] 11 Container With Most Water
- 11. Container With Most Water
- Container With Most Water-Leetcode OJ Problem 11
- LeetCode 11: Container With Most Water
- LeetCode11:Container With Most Water
- Leetcode 11 Container With Most Water
- LeetCode 11 Container With Most Water
- 11. Container With Most Water
- Medium 11题 Container With Most Water
- LeetCode 11 - Container With Most Water
- 11. Container With Most Water
- LeetCode 11 Container With Most Water