Compress the String!

  • + 0 comments

    from itertools import groupby

    A = input()

    B =groupby(A)

    for i, k in B: print((len(list(k)), int(i)), end=" ")