human
Find the only repeating element in a sorted array of size n | Returns index of second appearance of a repeating element The function assumes that array elements are in range from 1 to n - 1..
low = 0 , high = n - 1.
Check if the mid element is the repeating one.
If mid element is not at its position that means the repeated element is in left.
If mid is at proper position then repeated one is in right ..
Driver code"
How can the above be solved in Python?

What is a code to find the only repeating element in a sorted array of size n and the other steps required?
assistant
#Here is code to find the only repeating element in a sorted array of size n and the other steps required.
 def findRepeatingElement ( arr , low , high ) :
	if low > high :
		return - 1
	mid = ( low + high ) / 2
	if ( arr [ mid ] != mid + 1 ) :
		if ( mid > 0 and arr [ mid ] == arr [ mid - 1 ] ) :
			return mid
		return findRepeatingElement ( arr , low , mid - 1 )
	return findRepeatingElement ( arr , mid + 1 , high )
arr = [ 1 , 2 , 3 , 3 , 4 , 5 ]
n = len ( arr )
index = findRepeatingElement ( arr , 0 , n - 1 )
if ( index is not - 1 ) :
	print arr [ index ]