human
Check if each element of an Array is the Sum of any two elements of another Array | Function to check if each element of B [ ] can be formed by adding two elements of array A [ ].
Store each element of B [ ].
Traverse all possible pairs of array.
If A [ i ] + A [ j ] is present in the set.
Remove A [ i ] + A [ j ] from the set.
If set is empty.
Otherwise.
Driver Code"
How can the above be solved in Python?
 What is a code to check if each element of an Array is the Sum of any two elements of another Array and the other steps required?
assistant
#Here is code to check if each element of an Array is the Sum of any two elements of another Array and the other steps required.
 def checkPossible ( A , B , n ) :
	values = set ( [ ] )
	for i in range ( n ) :
		values . add ( B [ i ] )
	for i in range ( n ) :
		for j in range ( n ) :
			if ( ( A [ i ] + A [ j ] ) in values ) :
				values . remove ( A [ i ] + A [ j ] )
				if ( len ( values ) == 0 ) :
					break
	if ( len ( values ) == 0 ) :
		return " Yes "
	else :
		return " No "
if __name__ == " _ _ main _ _ " :
	N = 5
	A = [ 3 , 5 , 1 , 4 , 2 ]
	B = [ 3 , 4 , 5 , 6 , 7 ]
	print ( checkPossible ( A , B , N ) )