
    Write a function that analyzes a sequence of customer transactions to detect suspicious patterns by counting the number of times a later transaction is smaller than an earlier one, which could indicate potential fraud. Each value in the sequence represents a transaction amount or timestamp, and the count of such irregularities helps identify unusual customer behavior that warrants further investigation. The function should maintain the original transaction order while calculating these pattern violations.
    

    
def get_Inv_Count(arr):
    """
    Write a function that analyzes a sequence of customer transactions to detect suspicious patterns by counting the number of times a later transaction is smaller than an earlier one, which could indicate potential fraud. Each value in the sequence represents a transaction amount or timestamp, and the count of such irregularities helps identify unusual customer behavior that warrants further investigation. The function should maintain the original transaction order while calculating these pattern violations.
    

    """
def get_Inv_Count(arr):
    """
    Write a function that analyzes a sequence of customer transactions to detect suspicious patterns by counting the number of times a later transaction is smaller than an earlier one, which could indicate potential fraud. Each value in the sequence represents a transaction amount or timestamp, and the count of such irregularities helps identify unusual customer behavior that warrants further investigation. The function should maintain the original transaction order while calculating these pattern violations.
    

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