Run-length Encoding (medium)