public int maxArea(int[] height) {
        int mostWater = 0;

        int length = height.length;
        int left  = 0;
        int right = length -1;
        while(left < right){
            int h = (height[left] < height[right])? height[left]: height[right];
            int var = (right - left) * h;
            mostWater = mostWater > var ? mostWater: var ;
            if(height[left] < height[right]){
                left ++;
            }
            else
                right--;
        }

        return mostWater;
    }