
    In an adaptive learning platform, develop a function that analyzes a student's n most recent assessment scores and reorganizes them to group performance gaps (negative scores) before achievements (positive scores), while maintaining the chronological sequence within each group. The function should help identify learning patterns by separating areas needing improvement from areas of mastery, enabling the platform to adjust difficulty levels appropriately.
    

    
def re_arrange_array(arr, n):
    """
    In an adaptive learning platform, develop a function that analyzes a student's n most recent assessment scores and reorganizes them to group performance gaps (negative scores) before achievements (positive scores), while maintaining the chronological sequence within each group. The function should help identify learning patterns by separating areas needing improvement from areas of mastery, enabling the platform to adjust difficulty levels appropriately.
    

    """
def re_arrange_array(arr, n):
    """
    In an adaptive learning platform, develop a function that analyzes a student's n most recent assessment scores and reorganizes them to group performance gaps (negative scores) before achievements (positive scores), while maintaining the chronological sequence within each group. The function should help identify learning patterns by separating areas needing improvement from areas of mastery, enabling the platform to adjust difficulty levels appropriately.
    

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