public int maxArea2(int[] height, int start, int end, int max) {
        while (end > start) {
            int thisArea = Math.min(height[start], height[end]) * (end - start);
            if (thisArea > max)
                max = thisArea;
            if (height[start] > height[end])
                end--;
            else
                start++;
        }
        return max;
    }