Run-Length Compression

Programming Interview Hard 6 views
Back to Questions

Problem Description

Input provides {x}. Example aaabb becomes a3b2. Output compressed string.

Input Format

One string s.

Output Format

Compressed string.

Sample Test Case

Input:
aaabbc
Output:
a3b2c1

Constraints

1

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next