Lucid Imaging interview question

Run length encoding