#C926. Run-Length Encoding
Run-Length Encoding
Run-Length Encoding
You are given a string and you need to compress it using run-length encoding. In run-length encoding, consecutive occurrences of the same character are replaced by the number of occurrences followed by the character. For example, the string "aaabccccdde" is compressed to "3a1b4c2d1e". The input string may be empty. Your task is to implement the compression algorithm.
Note: When the input is an empty string, the output should also be an empty string.
inputFormat
A single line containing the input string. The string consists of lowercase letters and may be empty.
outputFormat
A single line displaying the compressed result using run-length encoding.## sample
aaabccccdde
3a1b4c2d1e