
    Write a function that validates a parking space configuration number where each digit represents the maximum allowed spots for different parking types (handicap, electric, standard), and ensures that the frequency of each digit in the configuration doesn't exceed its own value to prevent over-allocation. For example, in configuration 123, there can't be more than one '1', two '2's, or three '3's in the number.
    

    
def validate(n):
    """
    Write a function that validates a parking space configuration number where each digit represents the maximum allowed spots for different parking types (handicap, electric, standard), and ensures that the frequency of each digit in the configuration doesn't exceed its own value to prevent over-allocation. For example, in configuration 123, there can't be more than one '1', two '2's, or three '3's in the number.
    

    """
def validate(n):
    """
    Write a function that validates a parking space configuration number where each digit represents the maximum allowed spots for different parking types (handicap, electric, standard), and ensures that the frequency of each digit in the configuration doesn't exceed its own value to prevent over-allocation. For example, in configuration 123, there can't be more than one '1', two '2's, or three '3's in the number.
    

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