You are viewing a single comment's thread. Return to all comments →
import itertools n_list = input() result = tuple() iterator = itertools.groupby(n_list, lambda x: x[0]) for key, group in iterator: key_and_group = (len(list(group)), int(key),) result += (key_and_group,) print(*result)
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 →