0 String compression using the counts of repeated characters. Input : A string // aaaabbc Output : A string // a4b2c1 Logic : Iterate over the stringCompare the current and next characters.If both characters are not same, Then increment the count by 1 and do string concatenation. Solution : javascript 50 characters 1 compression 1 repeated 1 string 5 Please enable JavaScript to view the comments powered by Disqus.