Sha256: 3a82c096c6d4685edaafdadb2a4ee261197ec8b984563d4b17c98b13fcbb0384

Contents?: true

Size: 1.56 KB

Versions: 45

Compression:

Stored size: 1.56 KB

Contents

# Run Length Encoding

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.

In the following example, we can represent the original 53 characters with only 13.

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

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

```
"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 will always represent the count for the following character.

## Setup

Go through the setup instructions for EcmaScript to
install the necessary dependencies:

http://exercism.io/languages/ecmascript

## Requirements

Install assignment dependencies:

```bash
$ npm install
```

## Making the test suite pass

Execute the tests with:

```bash
$ npm test
```

In the test suites all tests but the first have been skipped.

Once you get a test passing, you can enable the next one by
changing `xtest` to `test`.

## Source

Wikipedia [https://en.wikipedia.org/wiki/Run-length_encoding](https://en.wikipedia.org/wiki/Run-length_encoding)

## Submitting Incomplete Solutions
It's possible to submit an incomplete solution so you can see how others have completed the exercise.

Version data entries

45 entries across 45 versions & 1 rubygems

Version Path
trackler-2.2.1.55 tracks/ecmascript/exercises/run-length-encoding/README.md
trackler-2.2.1.54 tracks/ecmascript/exercises/run-length-encoding/README.md
trackler-2.2.1.53 tracks/ecmascript/exercises/run-length-encoding/README.md
trackler-2.2.1.52 tracks/ecmascript/exercises/run-length-encoding/README.md
trackler-2.2.1.51 tracks/ecmascript/exercises/run-length-encoding/README.md
trackler-2.2.1.50 tracks/ecmascript/exercises/run-length-encoding/README.md
trackler-2.2.1.49 tracks/ecmascript/exercises/run-length-encoding/README.md
trackler-2.2.1.48 tracks/ecmascript/exercises/run-length-encoding/README.md
trackler-2.2.1.47 tracks/ecmascript/exercises/run-length-encoding/README.md
trackler-2.2.1.46 tracks/ecmascript/exercises/run-length-encoding/README.md
trackler-2.2.1.45 tracks/ecmascript/exercises/run-length-encoding/README.md
trackler-2.2.1.44 tracks/ecmascript/exercises/run-length-encoding/README.md
trackler-2.2.1.43 tracks/ecmascript/exercises/run-length-encoding/README.md
trackler-2.2.1.42 tracks/ecmascript/exercises/run-length-encoding/README.md
trackler-2.2.1.41 tracks/ecmascript/exercises/run-length-encoding/README.md
trackler-2.2.1.40 tracks/ecmascript/exercises/run-length-encoding/README.md
trackler-2.2.1.39 tracks/ecmascript/exercises/run-length-encoding/README.md
trackler-2.2.1.38 tracks/ecmascript/exercises/run-length-encoding/README.md
trackler-2.2.1.37 tracks/ecmascript/exercises/run-length-encoding/README.md
trackler-2.2.1.36 tracks/ecmascript/exercises/run-length-encoding/README.md