
    Given a list of social compatibility rankings between users in a social network, develop a function that identifies the number of mismatched friend recommendations by counting instances where users with higher compatibility scores appear after users with lower scores. The count of these mismatches (inversions) will help optimize the friend recommendation system by revealing discrepancies in relationship patterns.
    

    
def get_Inv_Count(arr):
    """
    Given a list of social compatibility rankings between users in a social network, develop a function that identifies the number of mismatched friend recommendations by counting instances where users with higher compatibility scores appear after users with lower scores. The count of these mismatches (inversions) will help optimize the friend recommendation system by revealing discrepancies in relationship patterns.
    

    """
def get_Inv_Count(arr):
    """
    Given a list of social compatibility rankings between users in a social network, develop a function that identifies the number of mismatched friend recommendations by counting instances where users with higher compatibility scores appear after users with lower scores. The count of these mismatches (inversions) will help optimize the friend recommendation system by revealing discrepancies in relationship patterns.
    

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