
    In a continuous stream of sorted movement sensor readings from an elderly patient's activity monitor, where regular movements generate paired identical readings, develop a function to identify the single unpaired reading that could indicate an irregular movement pattern. The readings are pre-sorted in ascending order, and all normal movement patterns appear exactly twice in the sequence except for one anomalous reading that appears only once.
    

    
def search(arr):
    """
    In a continuous stream of sorted movement sensor readings from an elderly patient's activity monitor, where regular movements generate paired identical readings, develop a function to identify the single unpaired reading that could indicate an irregular movement pattern. The readings are pre-sorted in ascending order, and all normal movement patterns appear exactly twice in the sequence except for one anomalous reading that appears only once.
    

    """
def search(arr):
    """
    In a continuous stream of sorted movement sensor readings from an elderly patient's activity monitor, where regular movements generate paired identical readings, develop a function to identify the single unpaired reading that could indicate an irregular movement pattern. The readings are pre-sorted in ascending order, and all normal movement patterns appear exactly twice in the sequence except for one anomalous reading that appears only once.
    

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