
    Design a fraud detection function that analyzes the n most recent customer transactions and reorganizes them to group all withdrawals before deposits while maintaining their chronological sequence within each type, enabling faster pattern recognition of suspicious banking activities. The function should process an array of transaction amounts where negative values represent withdrawals and positive values represent deposits, considering only the specified time window of n transactions.
    

    
def re_arrange_array(arr, n):
    """
    Design a fraud detection function that analyzes the n most recent customer transactions and reorganizes them to group all withdrawals before deposits while maintaining their chronological sequence within each type, enabling faster pattern recognition of suspicious banking activities. The function should process an array of transaction amounts where negative values represent withdrawals and positive values represent deposits, considering only the specified time window of n transactions.
    

    """
def re_arrange_array(arr, n):
    """
    Design a fraud detection function that analyzes the n most recent customer transactions and reorganizes them to group all withdrawals before deposits while maintaining their chronological sequence within each type, enabling faster pattern recognition of suspicious banking activities. The function should process an array of transaction amounts where negative values represent withdrawals and positive values represent deposits, considering only the specified time window of n transactions.
    

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