human
Find three element from different three arrays such that a + b + c = sum | Function to check if there is an element from each array such that sum of the three elements is equal to given sum ..
Store elements of first array in hash.
sum last two arrays element one by one.
Consider current pair and find if there is an element in a1 [ ] such that these three form a required triplet.
Driver code"
Solution in Python:
 Can you provide a code to find three element from different three arrays such that a + b + c = sum and the other steps required?
assistant
#Here is code to find three element from different three arrays such that a + b + c = sum and the other steps required.
 def findTriplet ( a1 , a2 , a3 , n1 , n2 , n3 , sum ) :
	s = set ( )
	for i in range ( n1 ) :
		s . add ( a1 [ i ] )
	for i in range ( n2 ) :
		for j in range ( n3 ) :
			if sum - a2 [ i ] - a3 [ j ] in s :
				return True
	return False
a1 = [ 1 , 2 , 3 , 4 , 5 ]
a2 = [ 2 , 3 , 6 , 1 , 2 ]
a3 = [ 3 , 24 , 5 , 6 ]
n1 = len ( a1 )
n2 = len ( a2 )
n3 = len ( a3 )
sum = 9
if findTriplet ( a1 , a2 , a3 , n1 , n2 , n3 , sum ) == True :
	print ( " Yes " )
else :
	print ( " No " )