LearnPy Hub
← Iterators & Generators problems
Hard

Runs with groupby

Read a word and print each run of identical letters as letter×count joined by spaces, using itertools.groupby. For aaabcc print a×3 b×1 c×2.

Input

One word.

Output

One line.

Sample 1

Input
aaabcc
Output
a×3 b×1 c×2

Sample 2

Input
a
Output
a×1
solution.py
Output appears here
Runs with groupby · Python practice problem · LearnPy Hub