
    Write a function for a patient monitoring system that takes in a sequence of vital sign readings and a time window length, and reorganizes the readings within that window so that all concerning measurements (indicated by negative values) are grouped before normal readings (positive values), while maintaining their chronological sequence within each group to help medical staff quickly identify patterns of deterioration.
    

    
def re_arrange_array(arr, n):
    """
    Write a function for a patient monitoring system that takes in a sequence of vital sign readings and a time window length, and reorganizes the readings within that window so that all concerning measurements (indicated by negative values) are grouped before normal readings (positive values), while maintaining their chronological sequence within each group to help medical staff quickly identify patterns of deterioration.
    

    """
def re_arrange_array(arr, n):
    """
    Write a function for a patient monitoring system that takes in a sequence of vital sign readings and a time window length, and reorganizes the readings within that window so that all concerning measurements (indicated by negative values) are grouped before normal readings (positive values), while maintaining their chronological sequence within each group to help medical staff quickly identify patterns of deterioration.
    

    """
    j = 0
    for i in range(0, n):
        if arr[i] < 0:
            temp = arr[i]
            arr[i] = arr[j]
            arr[j] = temp
            j = j + 1
    return arr