@@ -0,0 +1,997 @@
+public class Solution %7B%0A  // naive, brute-force approach over difference combinations of areas%0A  public int maxAreaNaive(int%5B%5D height) %7B%0A    int n = height.length;%0A    int area = 0;%0A    for (int i = 0; i %3C n; i++) %7B%0A      for (int j = i + 1; j %3C n; j++) %7B%0A        int sqr = Math.min(height%5Bi%5D, height%5Bj%5D) * (j - i);%0A        area = Math.max(area, sqr);%0A      %7D%0A    %7D%0A    return area;%0A  %7D%0A%0A  // Idea is moving pointer that will imply increase in area, for example, if left is less than%0A  // right at the current iteration, there is no point to move right, because it will be bound be%0A  // left pointer, but if we move left pointer we might get at least right pointer area.%0A  public int maxArea(int%5B%5D height) %7B%0A    int i = 0;%0A    int j = height.length - 1;%0A    int area = 0;%0A    while (i %3C j) %7B%0A      int sqr = Math.min(height%5Bi%5D, height%5Bj%5D) * (j - i);%0A      area = Math.max(area, sqr);%0A      if (height%5Bi%5D %3C height%5Bj%5D) %7B%0A        i++;%0A      %7D else %7B%0A        j--;%0A      %7D%0A    %7D%0A    return area;%0A  %7D%0A%7D%0A

add container with most water solution