
    Design a credit assessment function that reorganizes the n most recent financial indicators so that all risk factors (negative values) are evaluated before positive credit behaviors, while preserving the chronological order within each category to maintain historical significance in the analysis. The function should process an array of financial indicators where negative values represent credit risks and positive values represent favorable credit behaviors.
    

    
def re_arrange_array(arr, n):
    """
    Design a credit assessment function that reorganizes the n most recent financial indicators so that all risk factors (negative values) are evaluated before positive credit behaviors, while preserving the chronological order within each category to maintain historical significance in the analysis. The function should process an array of financial indicators where negative values represent credit risks and positive values represent favorable credit behaviors.
    

    """
def re_arrange_array(arr, n):
    """
    Design a credit assessment function that reorganizes the n most recent financial indicators so that all risk factors (negative values) are evaluated before positive credit behaviors, while preserving the chronological order within each category to maintain historical significance in the analysis. The function should process an array of financial indicators where negative values represent credit risks and positive values represent favorable credit behaviors.
    

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