human
Find the number of consecutive zero at the end after multiplying n numbers | Function to count two 's factor.
Count number of 2 s present in n.
Function to count five 's factor.
Function to count number of zeros.
Count the two 's factor of n number.
Count the five 's factor of n number.
Return the minimum.
Driver Code"
Solution in Python:
 ... What is a code to find the number of consecutive zero at the end after multiplying n numbers and the other steps required?
assistant
#Here is code to find the number of consecutive zero at the end after multiplying n numbers and the other steps required.
 def two_factor ( n ) :
	twocount = 0
	while n % 2 == 0 :
		twocount += 1
		n = int ( n / 2 )
	return twocount
def five_factor ( n ) :
	fivecount = 0
	while n % 5 == 0 :
		fivecount += 1
		n = int ( n / 5 )
	return fivecount
def find_con_zero ( arr , n ) :
	twocount = 0
	fivecount = 0
	for i in range ( n ) :
		twocount += two_factor ( arr [ i ] )
		fivecount += five_factor ( arr [ i ] )
	if twocount < fivecount :
		return twocount
	else :
		return fivecount
arr = [ 100 , 10 , 5 , 25 , 35 , 14 ]
n = 6
print ( find_con_zero ( arr , n ) )