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.
Thank you! I'm not sure why [mutating the argument] didn't give a bad test result on all of them.
I don't know if this is the best solution, but I just added this line as the first line of my function:
to make a separate copy of args to manipulate. After that, all my tests succeeded.
Classic one... ;)
Don't mutate the argument, it's bad practice (and it's what generate your troubles ;) )
I'm getting an issue with the random tests in Python.
There was a randome test with this input: [-69, -66, -65, -64, -63, -62, -59, -58, -55, -54, -53, -52]
and the test failed, giving me this error message:
It should work for random inputs too: '-69,-66--62,-59,-58,-55--52' should equal ''
I'm getting a lot of random tests where the unit test believes the output should be an empty string. Am I missing something in the instructions? I'm wondering if it's expecting '' because the input is invalid, but it doesn't look invalid to me.
@juliand665 -- ah! you're correct -- that makes sense.
There should really be more than one test case in the attempt to check for edge cases and prevent overfitting (and it's a kindness to have sample test cases pre-written :) )
Don't know much about ruby, but I'm pretty sure that's how they're converting the numbers to strings.
I don't know what post you're answering to, but what you're saying is false:
['this is', 'a good example'].join(' ')
=>'this is a good example'
'this is a good example'.split(' ')
=>['this', 'is', 'a', 'good', 'example']
thus
['this is', 'a good example'].join(' ').split(' ')
=>['this', 'is', 'a', 'good', 'example']
Why are you doing join(" ").split(" ")?
arr.join(" ").split(" ") == arr
I realize that these kata are written for multiple languages, but in Ruby this should really be written as a predicate:
Array.same_structure_as?(other)
since it only returns a boolean.
ugh. this is so elegant I hate my solution.
The instructions should be more clear, or the test cases should provide more output.
The script I wrote fails on the third test, but there is inadequate information in the Instructions to know what additional circumstances I should account for.