Very simple python solution.


  • 0
    Y

    Very simple python solution
    '''

     def maxArea(self, height)
    
        if len(height) == 0:
            return 0
        i = 0 
        j = len(height)-1
        total = 0
        
        while i <= j:
            total = max(min(height[i],height[j])*(j-i),total)
            if height[i] < height[j]:
                i+=1
            else:
                j-=1
        
        return total
    

    '''


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.