human
Find index of an extra element present in one sorted array | Returns index of extra . element in arr1 [ ] n is size of arr2 [ ] . Size of arr1 [ ] is n - 1..
Driver code.
Solve is passed both arrays"
How can the above be solved in Python?
assistant
#Here is code to find index of an extra element present in one sorted array and the other steps required.
 def findExtra ( arr1 , arr2 , n ) :
	for i in range ( 0 , n ) :
		if ( arr1 [ i ] != arr2 [ i ] ) :
			return i
	return n
arr1 = [ 2 , 4 , 6 , 8 , 10 , 12 , 13 ]
arr2 = [ 2 , 4 , 6 , 8 , 10 , 12 ]
n = len ( arr2 )
print ( findExtra ( arr1 , arr2 , n ) )