6 kyu
Run-length encoding
1,582 of 9,850bkaes
Loading description...
Strings
Algorithms
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
BF translation: https://www.codewars.com/kumite/681c93a20c01ca57d2241ffc?sel=681c93a20c01ca57d2241ffc
python new test framework is required. updated in this fork
Approved
Really interesting challenge, though I wish it was a little bit more harder.
Go translation.
NASM translation by stellartux.
Elixir translation ready for review and approval.
Approved by someone.
The pairs in the output should be tuples.
Nasm translation
Approved by someone.
Sorry, bug in my browser(?) I didn't see your translation pending approval, I reopen a suggestion for you.
Julia translation
Approved :)
Great kata for learning pointers and memory in C.
approved
This comment has been hidden.
C translation (author gone)
Approved :)
Around 1991, a daily file transmission from our office in Reading PA to Atlanta GA (via modem over dial-up connection) was taking way too long. The company was paying overtime for staff to stay late to "babysit" these slow transmissions. I took a close look at the data we were sending, and I discovered long strings of consecutive zeros. Having never heard of "run-length encoding," I decided to replace each string of consecutive zeros with a number representing its length. (I left all other characters untouched; only the strings of zeros were encoded.) Of course, I also wrote a corresponding program to decompress the data after it was received in Atlanta.
Compression made the file much smaller, and it was transmitted so much faster that my bosses questioned its accuracy. So I wrote another program just to compare the file before compression to the file after decompression and prove that the two files were identical.
And I've never stopped bragging about it :-)
BTW, this was programming in Report Program Generator (RPG) on an IBM System 36 midrange. Simpler days...
This comment has been hidden.
looks like u solved it
Pyhton:
fixed
Ruby:
nil
input should not be tested: it's not mentioned/specified in the description, and not tested in other languages (e.g. Python)fixed
This comment has been hidden.
Well, I guess I should learn more about
Control.Arrow
...There are a lot of RegExp solutions that shouldn't pass. Throw in some tests that cover repeated new line characters.
Language not specified; furthermore, it's rather a suggestion.
.
wildcard not matching\n
by default.The languages I completed (ruby, python) don't have tests with linebreaks, so it didn't make much sense :-) Anyway, if it was not done the last four years, I believe it will stay like this forever...
Yep, I'd imagine so. :P
This kata seems very easy if you know about a particular library function "f", and most of the solutions use it. It this intended, or should I find a solution that doesn't use "f"?
If you know about "f", it's trivial to implement it yourself. But yes, it's usage is actually intended. The other languages use simple regular expressions. But this kata isn't meant to be hard, it's more or less a quick exercise before your drink your coffee.
If you think it's to easy using the library, well, just implement it without it. :)