Container with Most Water | Python3 code for Max Water Container ; Calculating the max area ; Driver code
def maxArea ( A , Len ) : NEW_LINE INDENT area = 0 NEW_LINE for i in range ( Len ) : NEW_LINE INDENT for j in range ( i + 1 , Len ) : NEW_LINE INDENT area = max ( area , min ( A [ j ] , A [ i ] ) * ( j - i ) ) NEW_LINE DEDENT DEDENT return area NEW_LINE DEDENT a = [ 1 , 5 , 4 , 3 ] NEW_LINE b = [ 3 , 1 , 2 , 4 , 5 ] NEW_LINE len1 = len ( a ) NEW_LINE print ( maxArea ( a , len1 ) ) NEW_LINE len2 = len ( b ) NEW_LINE print ( maxArea ( b , len2 ) ) NEW_LINE