Group(), Groups() & Groupdict()

  • + 0 comments

    import re

    S = input()

    fount_it = re.search(r'([a-zA-Z0-9])\1+', S)

    if fount_it: print(fount_it.group(1)) else: print(-1)