You are viewing a single comment's thread. Return to all comments →
from itertools import groupby if __name__ == "__main__": s = input() print(" ".join(f"({len(list(group))}, {key})" for key, group in groupby(s)))
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 →