Run-length encoding (source code)

= Run-length encoding
{wiki=Run-length_encoding}

Run-length encoding (RLE) is a simple data compression technique that represents sequences of identical values (or "runs") in a more compact form. The basic principle of RLE is to replace consecutive occurrences of the same data value with a single value and a count of how many times that value occurs consecutively. \#\#\# How It Works 1. **Input**: Take a sequence of data that has repeated values.