
    Write a function that validates a delivery route identifier number where each digit represents the maximum allowed frequency for a specific time slot, ensuring that the actual occurrence of each digit in the number does not exceed its own value. For example, in route number 432, the digit 4 should not appear more than 4 times, 3 should not appear more than 3 times, and 2 should not appear more than 2 times.
    

    
def validate(n):
    """
    Write a function that validates a delivery route identifier number where each digit represents the maximum allowed frequency for a specific time slot, ensuring that the actual occurrence of each digit in the number does not exceed its own value. For example, in route number 432, the digit 4 should not appear more than 4 times, 3 should not appear more than 3 times, and 2 should not appear more than 2 times.
    

    """
def validate(n):
    """
    Write a function that validates a delivery route identifier number where each digit represents the maximum allowed frequency for a specific time slot, ensuring that the actual occurrence of each digit in the number does not exceed its own value. For example, in route number 432, the digit 4 should not appear more than 4 times, 3 should not appear more than 3 times, and 2 should not appear more than 2 times.
    

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