Compress the String!

  • + 0 comments

    from itertools import groupby

    s=input()

    for key, group in groupby(s): group_list=list(group) key=int(key) print (tuple((len(group_list),key)),end=" ")