
    Write a function that takes a route identifier number where each digit represents the maximum vehicle capacity for different delivery zones, and verify if the current number of vehicles operating in each zone (represented by the frequency of each digit) does not exceed their respective maximum capacity limits. For example, if a digit '4' appears 5 times in the route number, it would indicate an invalid distribution since the zone with maximum capacity of 4 vehicles cannot have 5 vehicles operating in it.
    

    
def validate(n):
    """
    Write a function that takes a route identifier number where each digit represents the maximum vehicle capacity for different delivery zones, and verify if the current number of vehicles operating in each zone (represented by the frequency of each digit) does not exceed their respective maximum capacity limits. For example, if a digit '4' appears 5 times in the route number, it would indicate an invalid distribution since the zone with maximum capacity of 4 vehicles cannot have 5 vehicles operating in it.
    

    """
def validate(n):
    """
    Write a function that takes a route identifier number where each digit represents the maximum vehicle capacity for different delivery zones, and verify if the current number of vehicles operating in each zone (represented by the frequency of each digit) does not exceed their respective maximum capacity limits. For example, if a digit '4' appears 5 times in the route number, it would indicate an invalid distribution since the zone with maximum capacity of 4 vehicles cannot have 5 vehicles operating in it.
    

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