
    In a bank's transaction log containing sorted transaction IDs, where legitimate transactions always appear exactly twice due to double-entry bookkeeping, write a function to identify the single unpaired transaction ID that could indicate potential fraud. The transaction log is guaranteed to be sorted in ascending order, and exactly one transaction ID appears only once while all others appear exactly twice.
    

    
def search(arr):
    """
    In a bank's transaction log containing sorted transaction IDs, where legitimate transactions always appear exactly twice due to double-entry bookkeeping, write a function to identify the single unpaired transaction ID that could indicate potential fraud. The transaction log is guaranteed to be sorted in ascending order, and exactly one transaction ID appears only once while all others appear exactly twice.
    

    """
def search(arr):
    """
    In a bank's transaction log containing sorted transaction IDs, where legitimate transactions always appear exactly twice due to double-entry bookkeeping, write a function to identify the single unpaired transaction ID that could indicate potential fraud. The transaction log is guaranteed to be sorted in ascending order, and exactly one transaction ID appears only once while all others appear exactly twice.
    

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