Compress the String!

  • + 0 comments

    from itertools import groupby A = input() for k, g in groupby(A): print(f"{len(list(g)), int(k)}", end=' ')