Problem Description

Compress string by showing character and its count. "aaabbc" -> "a3b2c1"
Real Life: Data compression basics.

Step-by-Step Logic:
1. Count consecutive same characters
2. Write character and its count
3. Move to next different character
4. Return compressed string

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next