human
Check if possible to make Array sum equal to Array product by replacing exactly one element | Function to check if it is possible to form an array whose sum and the product is the same or not.
Find the sum of the array.
.
Find the product of the array.
Check a complete integer y for every x.
If got such y.
If no such y exist.
Driver Code"
Solution in Python:
 ... Can you provide a code to check if possible to make Array sum equal to Array product by replacing exactly one element and the other steps required?
assistant
#Here is code to check if possible to make Array sum equal to Array product by replacing exactly one element and the other steps required.
 def canPossibleReplacement ( N , arr ) :
	S = sum ( arr )
/ * Iterate through all elements and
	add them to sum * /
	P = 1
	for i in arr :
		P *= i
	for x in arr :
		y = ( S - x ) // ( P / x - 1 )
		if ( S - x + y ) == ( P * y ) / x :
			return ' Yes '
	return ' No '
N , arr = 3 , [ 1 , 3 , 4 ]
print ( canPossibleReplacement ( N , arr ) )