← FactSet questions

Compress string by consecutive element counts

Filed under FactSet

Compress a string by replacing consecutive occurrences of characters with the character followed by the count of its consecutive repetitions.

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 FactSet questions

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