Let's examine a Python example. We have the array [1,2,2,3,3,4,4,5,5] and we need to identify the number that occurs only once: def singleNumber ( arr , low , high ) : if low > high : return None if low == high : return arr [ low ] mid = int ( ( high - low ) / 2 ) + low if mid % 2 == 0 : # The element at mid is the same as the next element if arr [ mid ] == arr [ mid + 1 ] : return singleNumber ( arr , mid + 2 , high ) else : return singleNumber ( arr , low , mid ) else : if arr [ mid ] == arr [ mid - 1 ] : return singleNumber ( arr , mid + 1 , high ) else : return singleNumber ( arr , low , mid - 1 ) # Sample driver code arr = [ 1 , 2 , 2 , 3 , 3 , 4 , 4 , 5 , 5 ] n = len ( arr ) print ( The element that appears once is' , singleNumber ( arr , 0 , n - 1 ) ) The function singleNumber employs a binary search technique and utilizes the concept of even index pairs to locate the single number within the array.