human
Find the element whose multiplication with | Function to find minimum index such that sum becomes 0 when the element is multiplied by - 1.
Find array sum.
Find element with value equal to sum / 2.
when sum is equal to 2 * element then this is our required element.
Driver code"
How can the above be solved in Python?
 ... Give me a code to find the element whose multiplication with and the other steps required?
assistant
#Here is code to find the element whose multiplication with and the other steps required.
 def minIndex ( arr , n ) :
	sum = 0
	for i in range ( 0 , n ) :
		sum += arr [ i ]
	for i in range ( 0 , n ) :
		if ( 2 * arr [ i ] == sum ) :
			return ( i + 1 )
	return - 1
arr = [ 1 , 3 , - 5 , 3 , 4 ] ;
n = len ( arr ) ;
print ( minIndex ( arr , n ) )