โ† Bloomberg questions

Run length encoding of a string

Filed under Bloomberg

Implement run length encoding: compress a string by replacing each run of identical consecutive characters with the character followed by the run length. For example, aaaaabbbccd becomes a5b3c2d1.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Bloomberg questions

Collected from public candidate posts and coding forums. Updated Nov 2026.