标签:style blog color os io ar div sp log
public class Solution { public int maxArea(int[] height) { int len = height.length, low = 0, high = len - 1; int area = 0; while (low<high) { area = Math.max(area, (high-low)* Math.min(height[low], height[high])); if (height[low] > height[high]) high --; else low++; } return area; } }
[LeetCode] Container With Most Water
标签:style blog color os io ar div sp log
原文地址:http://www.cnblogs.com/yuhaos/p/3960875.html