JavaScript icon indicating copy to clipboard operation
JavaScript copied to clipboard

Strings Compression

Open akshitagupta15june opened this issue 5 years ago • 1 comments

Take as input S, a string. Write a function that does basic string compression. Print the value returned. E.g. for input “aaabbccds” print out a3b2c2d1s1. Input Format

A single String S Constraints

1 < = length of String < = 1000 Output Format

The compressed String. Sample Input

aaabbccds

Sample Output

a3b2c2d1s1

Explanation

In the given sample test case 'a' is repeated 3 times consecutively, 'b' is repeated twice, 'c' is repeated twice and 'd and 's' occurred only once.

akshitagupta15june avatar Sep 25 '20 10:09 akshitagupta15june

Hey. I would like to work on this one.

arjkashyap avatar Oct 09 '20 05:10 arjkashyap