human
Find the one missing number in range | Find the missing number in a range.
here we xor of all the number.
xor last number.
Driver method"
How can the above be solved in Python?
assistant
#Here is code to find the one missing number in range and the other steps required.
 def missingNum ( arr , n ) :
	minvalue = min ( arr )
	xornum = 0
	for i in range ( 0 , n ) :
		xornum ^= ( minvalue ) ^ arr [ i ]
		minvalue = minvalue + 1
	return xornum ^ minvalue
arr = [ 13 , 12 , 11 , 15 ]
n = len ( arr )
print ( missingNum ( arr , n ) )