human
Find two non | Function to find two non - overlapping with same Sum in an array.
first create an empty Map key -> which is Sum of a pair of elements in the array value -> vector storing index of every pair having that Sum.
consider every pair ( arr [ i ] , arr [ j ] ) and where ( j > i ).
calculate Sum of current pair.
if Sum is already present in the Map.
check every pair having equal Sum.
if pairs don 't overlap,  print them and return.
Insert current pair into the Map.
If no such pair found.
Driver Code"
How can the above be solved in Python?

Give me a code to find two non and the other steps required?
assistant
#Here is code to find two non and the other steps required.
 def findPairs ( arr , size ) :
	Map = { }
	for i in range ( 0 , size - 1 ) :
		for j in range ( i + 1 , size ) :
			Sum = arr [ i ] + arr [ j ]
			if Sum in Map :
				for pair in Map [ Sum ] :
					m , n = pair
					if ( ( m != i and m != j ) and ( n != i and n != j ) ) :
						print ( " Pair ▁ First ▁ ( { } , ▁ { } ) " . format ( arr [ i ] , arr [ j ] ) )
						print ( " Pair ▁ Second ▁ ( { } , ▁ { } ) " . format ( arr [ m ] , arr [ n ] ) )
						return
			if Sum not in Map :
				Map [ Sum ] = [ ]
			Map [ Sum ] . append ( ( i , j ) )
	print ( " No ▁ such ▁ non - overlapping ▁ pairs ▁ present " )
if __name__ == " _ _ main _ _ " :
	arr = [ 8 , 4 , 7 , 8 , 4 ]
	size = len ( arr )
	findPairs ( arr , size )