diff --git a/compressString.py b/compressString.py new file mode 100644 index 0000000..ce3c114 --- /dev/null +++ b/compressString.py @@ -0,0 +1,6 @@ +#Question from hackerrank = https://www.hackerrank.com/challenges/compress-the-string/problem +from itertools import groupby +s=input() +for c,i in groupby(s): + x=(len(list(i)),int(c)) + print(x, end=" ")