Stack Overflow Interview Question

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