
    In a bank's sorted transaction log, where legitimate transactions typically occur in matching pairs due to standard customer behavior patterns, develop a function to identify the single anomalous transaction amount that appears only once. The transaction log is pre-sorted for efficient processing, and all normal transaction amounts appear exactly twice while the fraudulent amount occurs exactly once.
    

    
def search(arr):
    """
    In a bank's sorted transaction log, where legitimate transactions typically occur in matching pairs due to standard customer behavior patterns, develop a function to identify the single anomalous transaction amount that appears only once. The transaction log is pre-sorted for efficient processing, and all normal transaction amounts appear exactly twice while the fraudulent amount occurs exactly once.
    

    """
def search(arr):
    """
    In a bank's sorted transaction log, where legitimate transactions typically occur in matching pairs due to standard customer behavior patterns, develop a function to identify the single anomalous transaction amount that appears only once. The transaction log is pre-sorted for efficient processing, and all normal transaction amounts appear exactly twice while the fraudulent amount occurs exactly once.
    

    """
    n = len(arr)
    XOR = 0
    for i in range(n):
        XOR = XOR ^ arr[i]
    return XOR