LearnPy Hub
← Strings problems
Medium

Count Runs of Letters

Read a word and compress runs of the same letter as letter + count, e.g. aaabcc → a3b1c2.

Input

One word.

Output

One word.

Sample 1

Input
aaabcc
Output
a3b1c2

Sample 2

Input
abc
Output
a1b1c1
solution.py
Output appears here
Count Runs of Letters · Python practice problem · LearnPy Hub