
    Design a fraud detection function that identifies suspicious transaction patterns by counting the number of times a larger transaction amount appears before a smaller amount in a customer's transaction history sequence. Each pair of transactions where a larger amount precedes a smaller amount represents a potential anomaly that requires further investigation in the bank's anti-fraud system.
    

    
def get_Inv_Count(arr):
    """
    Design a fraud detection function that identifies suspicious transaction patterns by counting the number of times a larger transaction amount appears before a smaller amount in a customer's transaction history sequence. Each pair of transactions where a larger amount precedes a smaller amount represents a potential anomaly that requires further investigation in the bank's anti-fraud system.
    

    """
def get_Inv_Count(arr):
    """
    Design a fraud detection function that identifies suspicious transaction patterns by counting the number of times a larger transaction amount appears before a smaller amount in a customer's transaction history sequence. Each pair of transactions where a larger amount precedes a smaller amount represents a potential anomaly that requires further investigation in the bank's anti-fraud system.
    

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