#NEWLINE# def maxProduct( self , nums ) : #NEWLINE# #INDENT# if ( not nums ) : #NEWLINE# #INDENT# return 0 #NEWLINE# #UNINDENT# n = len ( nums ) #NEWLINE# smallest = list ( nums ) #NEWLINE# largest = list ( nums ) #NEWLINE# maxa = nums [ 0 ] #NEWLINE# for i in xrange ( 1 , n ) : #NEWLINE# #INDENT# v = nums [ i ] #NEWLINE# smallest [ i ] = min ( v , ( smallest [ ( i - 1 ) ] * v ) , ( largest [ ( i - 1 ) ] * v ) ) #NEWLINE# largest [ i ] = max ( v , ( smallest [ ( i - 1 ) ] * v ) , ( self [ ( i - 1 ) ] * v ) ) #NEWLINE# maxa = max ( maxa , largest [ i ] ) #NEWLINE# #UNINDENT# return maxa