
    Write a function that validates a bus route identifier number where each digit represents the maximum allowed frequency of stops with that capacity level on the route. The function should check if the actual frequency of each digit in the route number does not exceed the value of that digit itself, ensuring optimal passenger distribution across stops.
    

    
def validate(n):
    """
    Write a function that validates a bus route identifier number where each digit represents the maximum allowed frequency of stops with that capacity level on the route. The function should check if the actual frequency of each digit in the route number does not exceed the value of that digit itself, ensuring optimal passenger distribution across stops.
    

    """
def validate(n):
    """
    Write a function that validates a bus route identifier number where each digit represents the maximum allowed frequency of stops with that capacity level on the route. The function should check if the actual frequency of each digit in the route number does not exceed the value of that digit itself, ensuring optimal passenger distribution across stops.
    

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