You are viewing a single comment's thread. Return to all comments →
from itertools import groupby
input_value = input()
group_result = groupby(input_value)
for key,value in group_result:
value = sorted(list(value)) print(f"({int(len(value))}, {int(key)})", end=" ")
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 →
from itertools import groupby
input_value = input()
group_result = groupby(input_value)
for key,value in group_result: