Skip to main content

All Questions

Filter by
Sorted by
Tagged with
1 vote
2 answers
950 views

String Compression

Implement a method to perform basic string compression using the counts of repeated characters. For example, the string "aabcccccaaa" would become "a2b1c5a3". If the "...
Exploring's user avatar
  • 345
2 votes
2 answers
355 views

Naive string compression

Description: Implement a method to perform basic compression using counts of repeated characters. If the compressed string is not smaller then return the original string. Code: ...
CodeYogi's user avatar
  • 5,209
6 votes
2 answers
7k views

Perform basic string compression using the counts of repeated characters

I managed to implement this question from Cracking the Coding Interview: Implement a method to perform basic string compression using the counts of repeated characters. For example, the string <...
TheLearner's user avatar
11 votes
4 answers
33k views

Basic string compression counting repeated characters

My task was to implement a method which performs basic string compression by counting sequences of repeating characters. Given "aaabbbccc" it should return ...
user137717's user avatar
1 vote
2 answers
7k views

Run-length encoding using C

Recently I was asked in an interview to convert the string say "aabbbccccddddd" to "a2b3c4d5". i.e we have to avoid repeating same character and just adding the repeat count. Here 'a' is repeated ...
Prabu's user avatar
  • 111
3 votes
2 answers
12k views

Run Length Encoding

Given an input string, write a function that returns the Run Length Encoded string for the input string. For example, if the input string is “wwwwaaadexxxxxx”, then the function should return ...
Fihop's user avatar
  • 1,035