• + 0 comments

    When we do the "Roman Number Problem" before, and this one after, it's like playing Elden Ring without mimic first, then play Elden Ring with mimic x).

    Here the code :

    import re
    N = int(input())
    
    for _ in range(N):
        current_number = input()
        
        pattern = r"^[789]{1}\d{9}$"
        
        yes_or_no = bool(re.match(pattern, current_number))
        
        if yes_or_no:
            print("YES")
        else:
            print("NO")