Run-Length Encoding
PROStringsRun-Length Encoding
Iteration
Run-length encoding compresses a string by replacing each run of identical consecutive characters with the character and the length of the run.
Write a program that inputs a non-empty string of lowercase letters. For each run, in order, output the character on one line and the run length on the next line.
For example, `aaabbc` has runs of 3 `a`s, 2 `b`s and 1 `c`, so the output is:
```
a
3
b
2
c
1
```
Example Input
aaabbc
Example Output
a
3
b
2
c
1
0% (0 passed / 0 attempted)