Sha256: caa351f307b3eef2988dec848934ac6f933edc48c28a8a9189b68a15fb9a8814
Contents?: true
Size: 757 Bytes
Versions: 24
Compression:
Stored size: 757 Bytes
Contents
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. ``` "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" ``` If the string contains any whitespace, it should be passed through unchanged: ``` "aabc dddef" -> "2abc 3def" ``` For simplicity, you can assume that the unencoded string will only contain the letters A through Z (either lower or uppercase) and whitespace.
Version data entries
24 entries across 24 versions & 1 rubygems