
    Design a fraud detection function that analyzes sequences of credit card transactions to identify potentially suspicious spending patterns by counting pairs of transactions where a later transaction is smaller than an earlier one. Each transaction amount in the sequence is compared with subsequent transactions, where a higher amount followed by a lower amount could indicate account compromise or fraudulent behavior.
    

    
def get_Inv_Count(arr):
    """
    Design a fraud detection function that analyzes sequences of credit card transactions to identify potentially suspicious spending patterns by counting pairs of transactions where a later transaction is smaller than an earlier one. Each transaction amount in the sequence is compared with subsequent transactions, where a higher amount followed by a lower amount could indicate account compromise or fraudulent behavior.
    

    """
def get_Inv_Count(arr):
    """
    Design a fraud detection function that analyzes sequences of credit card transactions to identify potentially suspicious spending patterns by counting pairs of transactions where a later transaction is smaller than an earlier one. Each transaction amount in the sequence is compared with subsequent transactions, where a higher amount followed by a lower amount could indicate account compromise or fraudulent behavior.
    

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