human
Check if the array has an element which is equal to product of remaining elements | Function to Check if the array has an element which is equal to product of all the remaining elements.
Calculate the product of all the elements.
Return true if any such element is found.
If no element is found.
Driver code"
Solution in Python:
 ... Can you provide a code to check if the array has an element which is equal to product of remaining elements and the other steps required?
assistant
#Here is code to check if the array has an element which is equal to product of remaining elements and the other steps required.
 def CheckArray ( arr , n ) :
	prod = 1
	for i in range ( 0 , n , 1 ) :
		prod *= arr [ i ]
	for i in range ( 0 , n , 1 ) :
		if ( arr [ i ] == prod / arr [ i ] ) :
			return True
	return False
if __name__ == ' _ _ main _ _ ' :
	arr = [ 1 , 2 , 12 , 3 , 2 ]
	n = len ( arr )
	if ( CheckArray ( arr , n ) ) :
		print ( " YES " )
	else :
		print ( " NO " )