Pregunta de entrevista de Stack Overflow

Simple coding task: write a compression algorithm (Run-length encoding)