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
|
857 Discussions
|
Please Login in order to post a comment
from itertools import groupby
input_value = input()
group_result = groupby(input_value)
for key,value in group_result:
Core Python code (Without Built-in function)- We will appreciate itertools module some other time :
Here is HackerRank Compress the String! in python solution - https://programmingoneonone.com/hackerrank-compress-the-string-solution-in-python.html
import itertools
if name == 'main': S = input()