You are viewing a single comment's thread. Return to all comments →
from itertools import groupby my_iter = [int(n) for n in input()] k = [k for k, g in groupby(my_iter)] g = [list(g) for k, g in groupby(my_iter)] length = [len(i) for i in g] print(*(zip(length, k)))
Seems like cookies are disabled on this browser, please enable them to open this website
Compress the String!
You are viewing a single comment's thread. Return to all comments →