Challenge: File compression and "run-length encoding"
This challenge is meant to explore the basic idea behind file compression using a very naive type of compression called "run-length encoding". The idea behind run-length encoding is to take a string and replace all repeated sequences of characters with the number of times that character is repeated followed by that character. For example, we'd encode the string: WWWWWWAAAAAAWWWWWWAAAAAABBBBBB as: 6W6A6W6A6B As you can see, this "encoded" string is actually *shorter* than the input string but still contains all the information we need to reconstruct the original. On the other hand, the string "ABCEDFG" would be encoded as: 1A1B1C1D1E1F1G More info: http://en.wikipedia.org/wiki/Run-length_encoding * Make a program in any language(s) you want, to encode a string using run-length encoding. * Bonus: Make a decoder, also.