Group(), Groups() & Groupdict()

  • + 0 comments
    import re
    pattern = r'([A-Za-z0-9])\1+'
    l = re.findall(pattern , input().strip())
    print( l[0] if len(l) != 0 else -1)