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

Open Compression Sizes in Code Arena →