human
Smallest number dividing minimum number of elements in the Array | Function to return the smallest number that divides minimum number of elements.
m stores the maximum in the array.
Frequency table.
Loop to factorize.
sqrt factorization of the numbers.
Finding the smallest number with zero multiples.
Driver code"
How can the above be solved in Python?
 What is a code to smallest number dividing minimum number of elements in the Array and the other steps required?
assistant
#Here is code to smallest number dividing minimum number of elements in the Array and the other steps required.
 def findMin ( arr , n ) :
	m = 0
	for i in range ( n ) :
		m = max ( m , arr [ i ] )
	cnt = [ 0 ] * ( m + 2 )
	for i in range ( n ) :
		j = 1
		while j * j <= arr [ i ] :
			if ( arr [ i ] % j == 0 ) :
				if ( j * j == arr [ i ] ) :
					cnt [ j ] += 1
				else :
					cnt [ j ] += 1
					cnt [ arr [ i ] // j ] += 1
			j += 1
	for i in range ( 1 , m + 2 ) :
		if ( cnt [ i ] == 0 ) :
			return i
	return - 1
arr = [ 2 , 12 , 6 ]
n = len ( arr )
print ( findMin ( arr , n ) )