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.
Problem may have been modifying inputs, in which case you deserve whatever you get.
Closing.
simple!
The test cases did not expect for any nil, so it was probably in the solver code the part that added them; that said, I changed the tests again according to Insti suggestion to make them even more reliable.
The Ruby/Python translator will be able to assist when he comes online again.
The Ruby/Python translator will be able to assist when he comes online again.
I have asked Giacomo to have a look at his translations. It will be broken until he comes online again. Thanks for reporting it.
The simplest solution is to precompute the expected value before giving the argument list to the user for evaluation.
Your problem is that args.clone is not doing what you think it is doing.
This is a defect in the tests that should be fixed.
This thought and a tiny code change did indeed make my solution pass the tests. I sadly fail to see the reason :(.
Thanks for your input though. Oh and great kata btw :)
You may find your problem answered in the other issues posted here.
Avoid changing the original arrays passed to your method as this may then affect the randomly generated tests.
I get this in python too:
Testing for [[{'d': 8}, 1, 1, {'d': 8}, {'w': 4}, 4, 'r', {'s': 3}], ['s', 1, 1], ['a', 'a', 1], [{'o': 1}, 1, 'r', 1, 's']]
It should work for random inputs too: [{'d': 8}, 's', 'a', {'o': 1}, 1, 1, 'a', 1, 1, 1, 1, 'r', {'d': 8}, 1, {'w': 4}, 's', 4, 'r', {'s': 3}] should equal []
Edit: removed redundant list
Seems to be fixed now.
Thanks.
Ruby random tests are broken.
The expected value is always []
You're right, I did modify the array and so I modified my solution to not do so. I'll be more careful, thank you.
Hi!
Loving this kata in Ruby. I think I've found a solution but maybe also a problem with testing. On-submission tests are expecting nils when we've merged arrays with different sizes:
Testing for:
[{"c"=>5}, "c", "c", "s", "a"]
["w", {"s"=>5}, "a"]
It should work for random inputs too - Expected: [{"c"=>5}, "w", "c", {"s"=>5}, "c", "a", "s", nil, "a", nil]
This is, however, not the case for the default tests, where:
['a', 'b', 'c']
[1, 2, 3, 4, 5]
should yield: ['a', 1, 'b', 2, 'c', 3, 4, 5])
No nils here. Please adjust the tests accoridngly as the instructions also indicate that nil should not be expected with arrays of different sizes.
Thanks for the Ruby translation!
Loading more items...