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.
This comment is hidden because it contains spoiler information about the solution
The problem states that if the arguments are numbers then it can be assumed that neither will be 0. But I am getting a division by zero error in the random tests.
Thanks for that link - learned something new. Very interesting and helpful.
No sample tests for Ruby.
This comment is hidden because it contains spoiler information about the solution
The initial public test that executes when clicking the test button is broken. Actually, it looks like a test for a completely different kata (it is trying to call an
add
method, so you will get a confusing error about there not being anadd
method).To complete this kata, you have to skip pushing the test button and just click the attempt button instead.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This would fail for when the argument is "YX" though.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
The compare function for this solution returns a boolean, not 1, -1, or 0, which is required for sort to work. So the sort here doesn't actually do anything. I am not sure how it passed the tests.
Note that although this works, this is not best practice as a new copy of the bark method will be created for each instance, rather than sharing a single instance of the bark method via inheritance. No inheritance is being utilized here. So it results in unnecessary extra memory usage.
Loading more items...