human
Find the missing number in unordered Arithmetic Progression | Function to get the missing element.
For maximum element in the array.
For minimum Element in the array.
For xor of all elements.
Common difference of AP series.
Find maximum and minimum element.
Calculating common difference.
Calculate the XOR of all elements.
Perform XOR with actual AP series resultant x will be the ans.
Return the missing element.
Driver Code.
Given array.
Function Call.
Print the missing element"
Solution in Python:

=====
Write me a code to find the missing number in unordered Arithmetic Progression and the other steps required?
assistant
#Here is code to find the missing number in unordered Arithmetic Progression and the other steps required.
 def missingElement ( arr , n ) :
	max_ele = arr [ 0 ]
	min_ele = arr [ 0 ]
	x = 0
	d = 0
	for i in range ( n ) :
		if ( arr [ i ] > max_ele ) :
			max_ele = arr [ i ]
		if ( arr [ i ] < min_ele ) :
			min_ele = arr [ i ]
	d = ( max_ele - min_ele ) // n
	for i in range ( n ) :
		x = x ^ arr [ i ]
	for i in range ( n + 1 ) :
		x = x ^ ( min_ele + ( i * d ) )
	return x
if __name__ == ' _ _ main _ _ ' :
	arr = [ 12 , 3 , 6 , 15 , 18 ]
	n = len ( arr )
	element = missingElement ( arr , n )
	print ( element )