
    Design a function for a loan pre-qualification system that analyzes the n most recent credit indicators, reorganizing them so that all risk factors (represented by negative values) are evaluated before positive factors while maintaining their chronological sequence within each category. The function should process an array of credit-related indicators where negative values represent various risk factors and positive values represent favorable credit behaviors, considering only the n most recent entries for immediate loan pre-qualification assessment.
    

    
def re_arrange_array(arr, n):
    """
    Design a function for a loan pre-qualification system that analyzes the n most recent credit indicators, reorganizing them so that all risk factors (represented by negative values) are evaluated before positive factors while maintaining their chronological sequence within each category. The function should process an array of credit-related indicators where negative values represent various risk factors and positive values represent favorable credit behaviors, considering only the n most recent entries for immediate loan pre-qualification assessment.
    

    """
def re_arrange_array(arr, n):
    """
    Design a function for a loan pre-qualification system that analyzes the n most recent credit indicators, reorganizing them so that all risk factors (represented by negative values) are evaluated before positive factors while maintaining their chronological sequence within each category. The function should process an array of credit-related indicators where negative values represent various risk factors and positive values represent favorable credit behaviors, considering only the n most recent entries for immediate loan pre-qualification assessment.
    

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