We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Python
- Itertools
- Compress the String!
- Discussions
Compress the String!
Compress the String!
Sort by
recency
|
873 Discussions
|
Please Login in order to post a comment
Logic without using itertools.groupby() as:-
from itertools import groupby
A = input()
B =groupby(A)
for i, k in B: print((len(list(k)), int(i)), end=" ")