
    Given a list of maintenance scores for transit vehicles and the maintenance facility's current capacity n, reorganize the first n vehicles in the queue so that all vehicles requiring urgent repairs (indicated by negative scores) are prioritized before those needing routine maintenance (indicated by positive scores), while maintaining the original sequence within each category. The maintenance scores' absolute values indicate the severity or complexity of the required repairs, and the reorganization should preserve these relative priorities within both urgent and routine categories.
    

    
def re_arrange_array(arr, n):
    """
    Given a list of maintenance scores for transit vehicles and the maintenance facility's current capacity n, reorganize the first n vehicles in the queue so that all vehicles requiring urgent repairs (indicated by negative scores) are prioritized before those needing routine maintenance (indicated by positive scores), while maintaining the original sequence within each category. The maintenance scores' absolute values indicate the severity or complexity of the required repairs, and the reorganization should preserve these relative priorities within both urgent and routine categories.
    

    """
def re_arrange_array(arr, n):
    """
    Given a list of maintenance scores for transit vehicles and the maintenance facility's current capacity n, reorganize the first n vehicles in the queue so that all vehicles requiring urgent repairs (indicated by negative scores) are prioritized before those needing routine maintenance (indicated by positive scores), while maintaining the original sequence within each category. The maintenance scores' absolute values indicate the severity or complexity of the required repairs, and the reorganization should preserve these relative priorities within both urgent and routine categories.
    

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