
    At a busy intersection, vehicles arrive with predicted timestamps, and you need to identify the number of instances where a vehicle with an earlier expected arrival time is positioned behind a vehicle with a later arrival time. This count of out-of-sequence vehicle pairs helps traffic controllers identify potential congestion points and optimize signal timing to minimize traffic conflicts.
    

    
def get_Inv_Count(arr):
    """
    At a busy intersection, vehicles arrive with predicted timestamps, and you need to identify the number of instances where a vehicle with an earlier expected arrival time is positioned behind a vehicle with a later arrival time. This count of out-of-sequence vehicle pairs helps traffic controllers identify potential congestion points and optimize signal timing to minimize traffic conflicts.
    

    """
def get_Inv_Count(arr):
    """
    At a busy intersection, vehicles arrive with predicted timestamps, and you need to identify the number of instances where a vehicle with an earlier expected arrival time is positioned behind a vehicle with a later arrival time. This count of out-of-sequence vehicle pairs helps traffic controllers identify potential congestion points and optimize signal timing to minimize traffic conflicts.
    

    """
    inv_count = 0
    for i in range(len(arr)):
        for j in range(i + 1, len(arr)):
            if arr[i] > arr[j]:
                inv_count += 1
    return inv_count