6 kyu
Compress/Encode a Message with RLE (Run Length Encoding)
439user2619838
Description:
Run Length Encoding is used to compress data. RLE works like this: characters = "AAAALOTOOOOFTEEEEXXXXXXT" then the encoding will store AAAA = A4 and L1 So all together:
encode("AAAALOTOOOOFTEEEEXXXXXXT") == "A4L1O1T1O4F1T1E4X6T1"
# or
encode("HELLO WORLD") == "H1E1L2O1 1W1O1R1L1D1"
# or
encode("FOO+BAR") == "F1O2+1B1A1R1"
as you can see, its not always as efficient, but with some specific data it works!
Algorithms
Similar Kata:
Stats:
Created | Sep 12, 2016 |
Published | Sep 12, 2016 |
Warriors Trained | 811 |
Total Skips | 20 |
Total Code Submissions | 942 |
Total Times Completed | 439 |
Python Completions | 439 |
Total Stars | 14 |
% of votes with a positive feedback rating | 92% of 124 |
Total "Very Satisfied" Votes | 108 |
Total "Somewhat Satisfied" Votes | 13 |
Total "Not Satisfied" Votes | 3 |
Total Rank Assessments | 12 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 6 kyu |
Lowest Assessed Rank | 7 kyu |