public static int maxArea(int[] height) {
        int low = 0, high = height.length - 1;
        int maxarea = 0;
        while (low < high) {
        	int w = height[high] > height[low] ? height[low] : height[high];
        	int area = w * (high - low);
        	maxarea = maxarea > area ? maxarea : area;
        	if (height[high] > height[low]) low = low + 1;
        	else high = high - 1;
        }
    	return maxarea;
    }