String Compression Challenge
Description:
Write a Zipper
object that contains two methods: compress(string)
should accept a string and return a new string, compressed in some way; and decompress(string)
should accept a string as generated with compress
, and returns the original string, losslessly. As long as there is some compression on average, and no data is lost or changed, you'll pass the kata. I give you some stats at the end of the test. If you like, you can paste them into the comments at the top of the solution to show how awesome your algorithm is!
I am aware this is a somewhat odd kata to see here on CW. It's more of a challenge than a problem to solve. It will be interesting to see who can make the best algorithm based on this, though...
(NOTE: Must be able to handle empty strings.)
Require has been disabled.
Similar Kata:
Stats:
Created | May 18, 2014 |
Published | May 18, 2014 |
Warriors Trained | 574 |
Total Skips | 31 |
Total Code Submissions | 3224 |
Total Times Completed | 98 |
JavaScript Completions | 97 |
Total Stars | 21 |
% of votes with a positive feedback rating | 83% of 43 |
Total "Very Satisfied" Votes | 31 |
Total "Somewhat Satisfied" Votes | 9 |
Total "Not Satisfied" Votes | 3 |
Total Rank Assessments | 7 |
Average Assessed Rank | 4 kyu |
Highest Assessed Rank | 4 kyu |
Lowest Assessed Rank | 6 kyu |