public int maxArea(int[] height) {
        int left = 0, right = height.length -1;
        int max = 0;
        while(left < right){
            int area = Math.min(height[left], height[right]) * (right - left);
            max = area > max ? area : max;
            if(height[left] < height[right])
                left++;
            else
                right--;
        }
        return max;
    }