
    Write a function that validates a bank transaction identifier by ensuring each digit's frequency in the ID number does not exceed the digit's own value, which serves as a security rule to detect suspicious number patterns. For example, in a transaction ID, the digit '3' should not appear more than 3 times, the digit '5' should not appear more than 5 times, and so on.
    

    
def validate(n):
    """
    Write a function that validates a bank transaction identifier by ensuring each digit's frequency in the ID number does not exceed the digit's own value, which serves as a security rule to detect suspicious number patterns. For example, in a transaction ID, the digit '3' should not appear more than 3 times, the digit '5' should not appear more than 5 times, and so on.
    

    """
def validate(n):
    """
    Write a function that validates a bank transaction identifier by ensuring each digit's frequency in the ID number does not exceed the digit's own value, which serves as a security rule to detect suspicious number patterns. For example, in a transaction ID, the digit '3' should not appear more than 3 times, the digit '5' should not appear more than 5 times, and so on.
    

    """
    for i in range(10):
        temp = n
        count = 0
        while temp:
            if temp % 10 == i:
                count += 1
            if count > i:
                return False
            temp //= 10
    return True