Compress the String!

  • + 0 comments
    from itertools import groupby
    
    x = input()
    
    def grouper(x):
        res = [(len(list(g)), int(k)) for k, g in groupby(x)]
        return print(*res)