LearnPy Hub
← Strings problems
Hard

Shrink Repeated Letters

Read a word and write each run of the same letter as the letter followed by its count, like aaabcc → a3b1c2.

Input

One word.

Output

One line.

Sample 1

Input
aaabcc
Output
a3b1c2

Sample 2

Input
abc
Output
a1b1c1
solution.py
Output appears here
Shrink Repeated Letters · Python practice problem · LearnPy Hub