
    Write a function to validate special event codes in a social networking platform, where a valid code must be one less than twice its reverse digits (for example, 241 would be valid if it's one less than twice 142). These special codes are used to mark featured community events in the recommendation system.
    

    
def rev(num):
    rev_num = 0
    while num > 0:
        rev_num = rev_num * 10 + num % 10
        num = num // 10
    return rev_num

def check(n):
    """
    Write a function to validate special event codes in a social networking platform, where a valid code must be one less than twice its reverse digits (for example, 241 would be valid if it's one less than twice 142). These special codes are used to mark featured community events in the recommendation system.
    

    """
def rev(num):
    rev_num = 0
    while num > 0:
        rev_num = rev_num * 10 + num % 10
        num = num // 10
    return rev_num

def check(n):
    """
    Write a function to validate special event codes in a social networking platform, where a valid code must be one less than twice its reverse digits (for example, 241 would be valid if it's one less than twice 142). These special codes are used to mark featured community events in the recommendation system.
    

    """
    return 2 * rev(n) == n + 1