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.
Hey, I had issues with that case at first as well, but remember the structure of the variables does not depend on any strings or integers within them. i.e ['[','s'] has the same structure as [1,2] if I am not mistaken. So the data types within the list actually do not matter, what does matter is the structure, i.e [] of the list. That case is used to invalidate string conversions of the entire list.
you don't need the if statement.
It will automatically return an empty array if given an empty array because you already decalred newArr = []
Fixed ruby tests to include only valid values.
Well, 8k is syntax knowledge and 7k is language api knowledge. Seems more like a 6kyu kata for me. But yeah we can agree on fact that 5k is overrated.
plz check #5 of leader board, perhaps has some surprise
blueyedgeek 3 Style - https://www.codewars.com/users/blueyedgeek/site-events
This comment is hidden because it contains spoiler information about the solution
In the kata description, it is explicitly stated that the passed in array will only contain 0s 1s and 2s but in one of the test cases (Ruby), the array contains 4s as well. This edge case should be added to the kata description as well as what the method should do when it encounters invalid values such as this.
They probably marked it up in difficulty because there are no "run test" test cases at least for the ruby translation, but I agree with you. I think run test test cases should be added and this should moved to 7 or 8
This seems more like an eight (8) kyu kata rather than the five (5) it currently is.
In the last test case, we have to ensure that an array containing items in the format: [1, "[", "]"] is the same structure as an array with items in the format ["[", "]", 1]. Why should it be this way seeing as the data type for each item isn't really the same as the other array?
That's true, however it doesn't hurt performance to use double quotes when not interpolating.
Personally I prefer to use double quotes all the time for consistency (I follow option B from the Ruby Style Guide).
This comment is hidden because it contains spoiler information about the solution
Oh...ofcourse!