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.
I will try to review it again, because I haven't been programming for a long time, it's very possible to make a mistake, but when I do a test in my editor with the second test array, I get the correct result, anyway, thanks for the answer.
I fixed it ։)
uhh. it already was using that though.
.. ??
yes, your code works wrong for that test case.
.. go fix it? x)
if you think the test case is wrong then I don't think you looked at the test case, which makes me really confused - why wouldn't you even look at it before posting about it?
This comment is hidden because it contains spoiler information about the solution
The first value there is your answer, and you can see there are more than one 0 not at the end. Probably you're mutating the array at the same time you run through it, skipping values.
About what +0 is, you can see that's 0, don't mind the + before it, it's probably chai adding it in the assertion.
I don't understand what is wrong
expected [ 9, +0, 9, 1, 2, 1, 1, 3, 1, 9, +0, +0, 9, +0, +0, +0, +0, +0, +0, +0 ] to deeply equal [ 9, 9, 1, 2, 1, 1, 3, 1, 9, 9, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0 ]
+0 what is this?
counting number of occurrences 1
Actually,it's a easier than 5kyu problem, 7ky is enough
generic, works for lists and for strings (and probably iterables in general)
no
That's not a suggestion
So, this problem actually easy for 5 kyu. But if you tried to solve this
O(N)
and no extra memory, it feels like 5 kyu.If the array has only one element, the reduce function will not run and the string element will be returned.
Excelent lite-c0ding Kata)
expected: [true, "9", 8, "8", "8", nil, 1, 6, "2", 7, 3, nil, 5, true, nil, "1", "1", "0", "8", "1", 2, "5", "8", [], 0, 0]
does the test includes other data types?
Loading more items...