Compress the String!

  • + 0 comments
    from itertools import groupby
    s = input()
    for key, group in groupby(s):
        print((len(list(group)), int(key)), end=" ")