Compression Sizes
Medium · rating 1400 · Strings
Run-length encoding replaces each maximal run of a repeated character by the character followed by the run length (e.g. aaabb → a3b2). Read a string and print its original length and its run-length-encoded length, space-separated.
Constraints: 1 ≤ length ≤ 105
Related problems
- Count Anagram Groups — Medium
- Sort by Frequency — Medium
- Add Binary Strings — Medium
- Keypad Taps — Medium
- Balanced Brackets — Medium
- Election Winner — Medium