String Compression

Medium

📝 Description

Compress string by replacing consecutive chars with count

Input Format

A string

Output Format

Compressed string

Constraints

Length ≤ 1000

🔍 Sample Input

aaabbbcc
            

✅ Sample Output

a3b3c2
            

Code Editor

Please login to run and submit code.

Shortcuts: Ctrl+Enter to submit, Ctrl+Shift+R to run