Compress the String!

  • + 0 comments

    # Enter your code here. Read input from STDIN. Print output to STDOUT from itertools import groupby

    s= input().strip()

    for key , group in groupby(s): print(f"({len(list(group))}, {key})",end=' ')