
    Write a function that validates a social media post's risk assessment ID, where each digit represents a severity score (0-9) for different risk categories, by ensuring that the frequency of each severity score in the ID does not exceed its corresponding severity level. For example, severity score 3 should not appear more than 3 times in the ID, severity score 2 should not appear more than 2 times, and so on.
    

    
def validate(n):
    """
    Write a function that validates a social media post's risk assessment ID, where each digit represents a severity score (0-9) for different risk categories, by ensuring that the frequency of each severity score in the ID does not exceed its corresponding severity level. For example, severity score 3 should not appear more than 3 times in the ID, severity score 2 should not appear more than 2 times, and so on.
    

    """
def validate(n):
    """
    Write a function that validates a social media post's risk assessment ID, where each digit represents a severity score (0-9) for different risk categories, by ensuring that the frequency of each severity score in the ID does not exceed its corresponding severity level. For example, severity score 3 should not appear more than 3 times in the ID, severity score 2 should not appear more than 2 times, and so on.
    

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