
    Write a function that analyzes a credit card transaction identifier to detect potential fraud by verifying if each digit in the identifier appears no more times than its own value (e.g., digit 3 should appear 3 or fewer times). This security check helps identify suspicious transaction patterns where certain digits are artificially repeated beyond their natural frequency limits, which could indicate automated fraud attempts.
    

    
def validate(n):
    """
    Write a function that analyzes a credit card transaction identifier to detect potential fraud by verifying if each digit in the identifier appears no more times than its own value (e.g., digit 3 should appear 3 or fewer times). This security check helps identify suspicious transaction patterns where certain digits are artificially repeated beyond their natural frequency limits, which could indicate automated fraud attempts.
    

    """
def validate(n):
    """
    Write a function that analyzes a credit card transaction identifier to detect potential fraud by verifying if each digit in the identifier appears no more times than its own value (e.g., digit 3 should appear 3 or fewer times). This security check helps identify suspicious transaction patterns where certain digits are artificially repeated beyond their natural frequency limits, which could indicate automated fraud attempts.
    

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