
    Design a content moderation function that takes a list of social media posts with their sentiment scores and a batch size n, and reorganizes the first n posts so that all potentially harmful posts (with negative sentiment scores) appear before safe posts (with positive sentiment scores), while maintaining the chronological order within each category.
    

    
def re_arrange_array(arr, n):
    """
    Design a content moderation function that takes a list of social media posts with their sentiment scores and a batch size n, and reorganizes the first n posts so that all potentially harmful posts (with negative sentiment scores) appear before safe posts (with positive sentiment scores), while maintaining the chronological order within each category.
    

    """
def re_arrange_array(arr, n):
    """
    Design a content moderation function that takes a list of social media posts with their sentiment scores and a batch size n, and reorganizes the first n posts so that all potentially harmful posts (with negative sentiment scores) appear before safe posts (with positive sentiment scores), while maintaining the chronological order within each category.
    

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