human
Smallest possible integer to be added to N | Function to find the smallest positive integer X such that X is added to every element of A except one element to give array B.
Stores the unique elements of array A.
Insert A [ i ] into the set s.
Sort array A [ ].
Sort array B [ ].
Assume X value as B [ 0 ] - A [ 1 ].
Check if X value assumed is negative or 0.
Update the X value to B [ 0 ] - A [ 0 ].
If assumed value is wrong.
Update X value.
Driver Code"
Solution in Python:
 Write me a code to smallest possible integer to be added to N and the other steps required?
assistant
#Here is code to smallest possible integer to be added to N and the other steps required.
 def findVal ( A , B , N ) :
	s = set ( )
	for i in range ( N ) :
		s . add ( A [ i ] )
	A . sort ( )
	B . sort ( )
	X = B [ 0 ] - A [ 1 ]
	if ( X <= 0 ) :
		X = B [ 0 ] - A [ 0 ]
	else :
		for i in range ( N - 1 ) :
			if ( B [ i ] - X not in s ) :
				X = B [ 0 ] - A [ 0 ]
				break
	print ( X )
if __name__ == ' _ _ main _ _ ' :
	A = [ 1 , 4 , 3 , 8 ]
	B = [ 15 , 8 , 11 ]
	N = len ( A )
	findVal ( A , B , N )