public class Solution {
public int maxArea(int[] height) {
int i=0,j=height.length-1;
int result=0;
while(i<j){
if(result<Math.min(height[i],height[j])*(j-i)){
result=Math.min(height[i],height[j])*(j-i);
}
if(height[i]<height[j])i++;else j--;
}
return result;
}
}