Article directory
Topic Simple Compression Algorithm
There is a simple compression algorithm: for a string composed of all lowercase English letters, compress the part with more than two consecutive identical letters into a continuous number plus the other part of the letter remains unchanged. For example, the string is compressed
intoaaabbccccd
characters string3abb4cd
Please write a decompression function to judge whether it is a legally compressed string according to the input string
- If the input is legal, output the decompressed string
- otherwise