
    Given a list of patient readmission risk scores where negative values indicate high-risk cases requiring immediate attention and positive values represent low-risk cases, reorganize the most recent n patient cases so that all high-risk patients appear before low-risk ones while maintaining the original chronological order within each risk category. The severity level of each case, represented by the magnitude of the score, must be preserved in the final arrangement.
    

    
def re_arrange_array(arr, n):
    """
    Given a list of patient readmission risk scores where negative values indicate high-risk cases requiring immediate attention and positive values represent low-risk cases, reorganize the most recent n patient cases so that all high-risk patients appear before low-risk ones while maintaining the original chronological order within each risk category. The severity level of each case, represented by the magnitude of the score, must be preserved in the final arrangement.
    

    """
def re_arrange_array(arr, n):
    """
    Given a list of patient readmission risk scores where negative values indicate high-risk cases requiring immediate attention and positive values represent low-risk cases, reorganize the most recent n patient cases so that all high-risk patients appear before low-risk ones while maintaining the original chronological order within each risk category. The severity level of each case, represented by the magnitude of the score, must be preserved in the final arrangement.
    

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