Compress the String!

  • + 0 comments
    from itertools import groupby
    a=input()
    for k,v in groupby(a):
        print((len(list(v)),int(k)),end=" ")