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.
Can you add assertion messages for random tests?
There is no specification on recursive callbacks, e.g what happens if someone does
? If anything this kata is like a toy model: only works on a handful of very tiny examples, and not ready for any real world use.
You used my previous solution ;)
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.
What is the actual purpose of "One Away"?.
To compare a pair of ranges, strings or arrays?.
Would appreciate some comments.
Many regards,
A very green Ruby rookie... :)
Maybe change the function nameto follow best practise, like
equal_sum?
.awesome!but (d=='L') will be more readable.
As long as you provide an expression that is of boolean type, you can do it! :)
As the Safe Navigation Operator,
&
deals with the possibility ofnil
when calling the method on the object – maybe consider&.
together here: https://stackoverflow.com/questions/36812647/what-does-ampersand-dot-mean-in-rubywhat does the & do?
Not just python, you're just giving a boolean to a function without storing it in an intermediate variable.
This works in almost every langage.
This comment is hidden because it contains spoiler information about the solution
Looks like secret tests are working differently: main class is not unloaded each time.
The most confusing is
I've payed a lot of time to understande expected behavior from tests. Please describe it more accurate inside Instructoins.
Too advanced for me.
Loading more items...