Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Been a very long time since I touched this, but it's string comparison to see if one string can be transformed into a second string only by adding, removing or swapping a single character.
With that said, we were apparently code golfing and optimizing performance just for fun, you should absolutely not take this code as a good example of well-written Ruby.
Good suggestion, my solution definitely was affected by this bug as well.
I don't think it makes sense to have
before
andafter
callbacks function differently so I chose not to do that, i.e. registering callbacks like so:should call
before1
->before2
->test_method
->after1
->after2
.Ruby Translation
Ruby translation:
https://www.codewars.com/kumite/610d820a3c1d9d0048f5be31?sel=610d820a3c1d9d0048f5be31
Nice job! This one was fun.
Clever on the walrus operator
I would have made it a one-liner, but squaring the result was giving inconsistent issues. Saving the result to a temp variable and squaring that seems to solve it...?
Fewer characters, low score wins!
(Obviously this solution would be terrible in production.)
Ruby translation kumited:
https://www.codewars.com/kumite/5e6a5366f43e260015dbf842?sel=5e6a5366f43e260015dbf842
Ha, why though?
It works, sometimes.
EmBRACE the curly braces...
Clever, I'm not sure how it gets any faster than that.
I fixed the warnings on submission, but given this kata is 8kyu, I think the passing state is reasonable. Having the author solution length shown is also nice to shoot for.
Code here if you want to try:
Loading more items...