human
Find the Substring with maximum product | Function to return the value of a character.
Function to find the maximum product sub.
To store subs.
Check if current product is maximum possible or not.
If product is 0.
Return the sub with maximum product.
Driver code.
Function call"
How can the above be solved in Python?
 What is a code to find the Substring with maximum product and the other steps required?
assistant
#Here is code to find the Substring with maximum product and the other steps required.
 def value ( x ) :
	return ( ord ( x ) - ord ( ' a ' ) )
def maximumProduct ( strr , n ) :
	answer = " "
	curr = " "
	maxProduct = 0
	product = 1
	for i in range ( n ) :
		product *= value ( strr [ i ] )
		curr += strr [ i ]
		if ( product >= maxProduct ) :
			maxProduct = product
			answer = curr
		if ( product == 0 ) :
			product = 1
			curr = " "
	return answer
if __name__ == ' _ _ main _ _ ' :
	strr = " sdtfakdhdahdzz "
	n = len ( strr )
	print ( maximumProduct ( strr , n ) )