Sha256: e0fc19a1112a11fe6fb7864ce0fc25ad75f0ea0d894d303c8cd444023a3df3a1

Contents?: true

Size: 847 Bytes

Versions: 52

Compression:

Stored size: 847 Bytes

Contents

Implement run-length encoding and decoding.

Run-length encoding (RLE) is a simple form of data compression, where runs
(consecutive data elements) are replaced by just one data value and count.

For example we can represent the original 53 characters with only 13.

```text
"WWWWWWWWWWWWBWWWWWWWWWWWWBBBWWWWWWWWWWWWWWWWWWWWWWWWB"  ->  "12WB12W3B24WB"
```

RLE allows the original data to be perfectly reconstructed from
the compressed data, which makes it a lossless data compression.

```text
"AABCCCDEEEE"  ->  "2AB3CD4E"  ->  "AABCCCDEEEE"
```

For simplicity, you can assume that the unencoded string will only contain
the letters A through Z (either lower or upper case) and whitespace. This way
data to be encoded will never contain any numbers and numbers inside data to
be decoded always represent the count for the following character.

Version data entries

52 entries across 52 versions & 1 rubygems

Version Path
trackler-2.2.1.164 tracks/c/exercises/run-length-encoding/README.md
trackler-2.2.1.163 tracks/c/exercises/run-length-encoding/README.md
trackler-2.2.1.162 tracks/c/exercises/run-length-encoding/README.md
trackler-2.2.1.161 tracks/c/exercises/run-length-encoding/README.md
trackler-2.2.1.160 tracks/c/exercises/run-length-encoding/README.md
trackler-2.2.1.159 tracks/c/exercises/run-length-encoding/README.md
trackler-2.2.1.158 tracks/c/exercises/run-length-encoding/README.md
trackler-2.2.1.157 tracks/c/exercises/run-length-encoding/README.md
trackler-2.2.1.156 tracks/c/exercises/run-length-encoding/README.md
trackler-2.2.1.155 tracks/c/exercises/run-length-encoding/README.md
trackler-2.2.1.154 tracks/c/exercises/run-length-encoding/README.md
trackler-2.2.1.153 tracks/c/exercises/run-length-encoding/README.md
trackler-2.2.1.152 tracks/c/exercises/run-length-encoding/README.md
trackler-2.2.1.151 tracks/c/exercises/run-length-encoding/README.md
trackler-2.2.1.150 tracks/c/exercises/run-length-encoding/README.md
trackler-2.2.1.149 tracks/c/exercises/run-length-encoding/README.md
trackler-2.2.1.148 tracks/c/exercises/run-length-encoding/README.md
trackler-2.2.1.147 tracks/c/exercises/run-length-encoding/README.md
trackler-2.2.1.146 tracks/c/exercises/run-length-encoding/README.md
trackler-2.2.1.145 tracks/c/exercises/run-length-encoding/README.md