https://leetcode.com/problems/container-with-most-water/ 给出一个非负整数数组,每一个整数表示一个竖立在坐标轴x位置的一堵高度为该整数的墙,选择两堵墙,和x轴构成的容器可以容纳最多的水 ```java class Solution { public int maxArea(int[] height) { int i = 0, j = height.length - 1; int max = 0; while(i < j){ max = Math.max(max, Math.min(height[i], height[j])*(j-i)); if(height[i] < height[j]){ i++; }else{ j--; } } return max; } } ``` 欢迎光临[我的博客](http://www.wangtianyi.top/?utm_source=github&utm_medium=github),发现更多技术资源~