You are viewing a single comment's thread. Return to all comments →
from itertools import groupby c = input() c_final = [] for key, group in groupby(c): key = int(key) c_final.append((len(list(group)), key)) print(*c_final)
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 →