human
Given two unsorted arrays , find all pairs whose sum is x | Function to print all pairs in both arrays whose sum is equal to given value x.
Driver code"
Solution in Python:
assistant
#Here is code to given two unsorted arrays , find all pairs whose sum is x and the other steps required.
 def findPairs ( arr1 , arr2 , n , m , x ) :
	for i in range ( 0 , n ) :
		for j in range ( 0 , m ) :
			if ( arr1 [ i ] + arr2 [ j ] == x ) :
				print ( arr1 [ i ] , arr2 [ j ] )
arr1 = [ 1 , 2 , 3 , 7 , 5 , 4 ]
arr2 = [ 0 , 7 , 4 , 3 , 2 , 1 ]
n = len ( arr1 )
m = len ( arr2 )
x = 8
findPairs ( arr1 , arr2 , n , m , x )