human
Write a python function to find the element that appears only once in a sorted array. Here is a solution in Python:
assistant
#Here is Python code to find the element that appears only once in a sorted array.
 def search(arr):
    n = len(arr)
    XOR = 0
    for i in range(n) :
        XOR = XOR ^ arr[i]
    return (XOR)