Compress the String!

  • + 0 comments

    My solution:-

    from itertools import groupby
    S=input()
    print(*[(len(tuple(elements)), key) for key, elements in groupby(S, int)])