Microsoft interview question

Run-length Encoding Algorithm