solulubeta
Sign in
Story Problems / Strings
02.09 · Problem

Compress the Chant

Easy Run-length encoding Pro

This problem is part of solulu Pro

A monk's chant is a string like aabcccccaaa. To save ink he writes each letter followed by how many times it repeats in a row: a2b1c5a3. He only uses the short form if it is strictly shorter than the original, otherwise…

Lifetime ₹2,000 ₹1,000 · Beta offer
Mark this problem as solved when you are finished.

Item 29 of 94 · updated 2026-10-12