Skip to content

Latest commit

 

History

History
17 lines (12 loc) · 321 Bytes

File metadata and controls

17 lines (12 loc) · 321 Bytes

Problem 13: String Compression

Problem Statement

Compress a string using counts of repeated characters. Return original if compressed is not shorter.

Input Format

  • A string s.

Output Format

  • A string.

Constraints

  • 1 <= len(s) <= 10^4

Example

Input: s="aabcccccaaa"
Output: "a2b1c5a3"