Compress the String!

  • + 0 comments

    from itertools import groupby s1=(input()) list1=[] for k, g in groupby(s1):
    list1.append((len(tuple(g)),int(k))) print(*list1)