Detect HTML Tags

  • + 0 comments
    import re
    pattern =  r'<(\w+)>?'
    lst = []
    
    for i in range(int(input())):
        m = re.findall(pattern, input())
        for i in m:
            if i not in lst:
                lst.append(i)
    print(';'.join(sorted(lst)))