Stack Overflow interview question

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