
    Given a list of expected investment returns and a priority count n, restructure the first n investment options so that all high-risk investments (with negative expected returns) are placed before safer investments (with positive expected returns), while maintaining the original ordering within each risk category to preserve the client's preferences. The reorganization should only affect the specified number of priority investments while keeping the remaining portfolio unchanged.
    

    
def re_arrange_array(arr, n):
    """
    Given a list of expected investment returns and a priority count n, restructure the first n investment options so that all high-risk investments (with negative expected returns) are placed before safer investments (with positive expected returns), while maintaining the original ordering within each risk category to preserve the client's preferences. The reorganization should only affect the specified number of priority investments while keeping the remaining portfolio unchanged.
    

    """
def re_arrange_array(arr, n):
    """
    Given a list of expected investment returns and a priority count n, restructure the first n investment options so that all high-risk investments (with negative expected returns) are placed before safer investments (with positive expected returns), while maintaining the original ordering within each risk category to preserve the client's preferences. The reorganization should only affect the specified number of priority investments while keeping the remaining portfolio unchanged.
    

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