
    Design a function for a bank's fraud detection system that identifies a suspicious transaction amount from a sorted sequence of credit card purchases, where legitimate transaction amounts always appear in pairs while the fraudulent amount appears exactly once. The transaction amounts are pre-sorted in ascending order, and the function must efficiently detect the single unpaired amount that could indicate potential fraud.
    

    
def search(arr):
    """
    Design a function for a bank's fraud detection system that identifies a suspicious transaction amount from a sorted sequence of credit card purchases, where legitimate transaction amounts always appear in pairs while the fraudulent amount appears exactly once. The transaction amounts are pre-sorted in ascending order, and the function must efficiently detect the single unpaired amount that could indicate potential fraud.
    

    """
def search(arr):
    """
    Design a function for a bank's fraud detection system that identifies a suspicious transaction amount from a sorted sequence of credit card purchases, where legitimate transaction amounts always appear in pairs while the fraudulent amount appears exactly once. The transaction amounts are pre-sorted in ascending order, and the function must efficiently detect the single unpaired amount that could indicate potential fraud.
    

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