
    Given a patient's historical health indicators where negative values represent risk factors and positive values represent protective factors, develop a function that analyzes the n most recent indicators and reorganizes them to group all risk factors before protective factors while maintaining their chronological sequence within each group, enabling clearer visualization of recent health patterns for readmission risk assessment. The function should process normalized health data points and preserve the relative timing of events within both risk and protective categories to maintain the temporal context of the patient's health trajectory.
    

    
def re_arrange_array(arr, n):
    """
    Given a patient's historical health indicators where negative values represent risk factors and positive values represent protective factors, develop a function that analyzes the n most recent indicators and reorganizes them to group all risk factors before protective factors while maintaining their chronological sequence within each group, enabling clearer visualization of recent health patterns for readmission risk assessment. The function should process normalized health data points and preserve the relative timing of events within both risk and protective categories to maintain the temporal context of the patient's health trajectory.
    

    """
def re_arrange_array(arr, n):
    """
    Given a patient's historical health indicators where negative values represent risk factors and positive values represent protective factors, develop a function that analyzes the n most recent indicators and reorganizes them to group all risk factors before protective factors while maintaining their chronological sequence within each group, enabling clearer visualization of recent health patterns for readmission risk assessment. The function should process normalized health data points and preserve the relative timing of events within both risk and protective categories to maintain the temporal context of the patient's health trajectory.
    

    """
    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