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 Kata is very flawed: 1.) The description is wrong, since it messes up the correct terminology. What the kata wants is to have the VALUES of the hashes(Ruby)/ dictionaries(Python) summed up and not their KEYS. 2.) The sample tests (button "Test") are completely broken for Ruby, you can't use them and have to go directly to the full test suite (button "Attempt") which is detrimental to the user's statistics ("Kata solved on first attempt").
Description does not mention whether the array will only have two or more key-value pairs. If the final requirement is having two and only two key-value pairs, then the last two parameters are redundant, hence should be removed
No sample tests
Ruby 3.0 should be enabled
no random tests
Translated to Javascript.
Coming back again to "Remove odd hashes" task, it is not clear either what the additional parameters :a and :b are passed in for ? Should we check the sum of only :a keys, only :b keys, or :a and :b key in the provided hash?
I think the task 'remove any hash whose two keys sum to an odd number.' should be rephrased to be clearer. For me, we can't sum the keys (:a, :b in this case) but sooner their values which are integers.
The test cases do not check for other keys than :a, :b so hardcoded solutoins unfortunatelly work.
This kata has very unclear description... For what sake do you need key_1 and key_2? oO
Sorry, can you clarify which point you are responding to? Where were the right arguments not used?
That's because you didn't use the right arguments, if you write a test, you should see related error messages.
I'm the only person that hasen't used either the % or + operators so far...
Well actually is all up to the user to determine the array replaced or a new one, I'm just checking the output to be correct
you should add a test for index = -1
default_value = 5
data = [1, 2, 3]
data[-2] == 2
I have seen many solutions that will not return the correct value