You are viewing a single comment's thread. Return to all comments →
import itertools string = input() groups = itertools.groupby(string) results = [] for key, group in groups: count = 0 for item in group: count += 1 results.append((count, int(key))) print(*results)
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 →