@@ -0,0 +1,1196 @@
+/**%0A *%09Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). %0A *%09n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i, 0). %0A *%09Find two lines, which together with x-axis forms a container, %0A *%09such that the container contains the most water.%0A *%0A *%09Note: You may not slant the container%0A *%0A *%09Given %5B1,3,2%5D, the max area of the container is 2.%0A *%0A *%09Author: matao%0A *%0A */%0A%0Apublic class ContainerWithMostWater %7B%0A%09public static int maxArea(int%5B%5D height) %7B%0A        if(height == null %7C%7C height.length == 0) %7B%0A        %09return 0;%0A        %7D%0A        int left = 0;%0A        int right = height.length-1;%0A        int max = 0;%0A        while(left %3C right) %7B%0A        %09int h = height%5Bleft%5D %3C height%5Bright%5D ? height%5Bleft%5D : height%5Bright%5D;%0A        %09int w = right - left;%0A        %09int square = h * w;%0A        %09if(max %3C square) %7B%0A        %09%09max = square;%0A        %09%7D%0A        %09if(height%5Bleft%5D %3C height%5Bright%5D) %7B%0A        %09%09left++;%0A        %09%7D else %7B%0A        %09%09right--;%0A        %09%7D%0A        %7D%0A        return max;%0A    %7D%0A%0A    public static void main(String%5B%5D args) %7B%0A    %09int%5B%5D height1 = %7B1, 3, 2%7D;%0A    %09System.out.println(maxArea(height1));%0A    %7D%0A%7D

add Container With Most Water solution