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 is not even an issue with spec, the kata generates the expected answer before passing the argument to the user's function. In this case, the user is mutating the list as they iterate through it, causing issues. I'm closing this issue.
There is a
false
value in that input as well as[]
(an empty array). The actual input for that test is['a', 0, 0, 'b', null, 'c', 'd', 0, 1, false, 0, 1, 0, 3, [], 0, 1, 9, 0, 0, {}, 0, 0, 9]
.expected [ 'a', 'b', null, 'c', 'd', 1, 1, 3, 1, 9, {}, 9, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0 ] to deeply equal [ 'a', 'b', null, 'c', 'd', 1, false, 1, 3, [], 1, 9, {}, 9, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0 ]
means that your code returned[ 'a', 'b', null, 'c', 'd', 1, 1, 3, 1, 9, {}, 9, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0 ]
, but it should have returned[ 'a', 'b', null, 'c', 'd', 1, false, 1, 3, [], 1, 9, {}, 9, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0 ]
. The message you copied does not mention the input to the function.This problem is caused by a bug in your code. For future reference, the
issue
tag is meant to be used when there is a problem with the actual kata. You can use thequestion
tag if you need help with your own code.As to the reason this is happening, make sure your code isn't confusing
false
and[]
with0
.0
,false
, and[]
are all falsey values, so it seems like your code might be confusing them.I think this testcase is wrong
expected [ 'a', 'b', null, 'c', 'd', 1, 1, 3, 1, 9, {}, 9, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0 ] to deeply equal [ 'a', 'b', null, 'c', 'd', 1, false, 1, 3, [], 1, 9, {}, 9, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0 ]
In the first array there is no 'false' however the second array has a false for some odd reason.
There is also not a square bracket in the first array, however there is one in the second array. Can you help me out ?
done
i litrally had to go study this before answering it.
C#:
params int[] ...
to be in-line with the description about passing argumentsGo fork
Ranks cannot be changed as of now, especially for old katas like this one
This comment is hidden because it contains spoiler information about the solution
@Carl98K 0 and +0 evaluate to the same thing, you wouldn't be able to detect a difference as no difference exists between two of the same value. The problem is that your algorithm is flawed - you are reading from and writing to the same object without taking care to ensure that the writes don't affect the reads. Like peeing upstream and then getting it in your drinking water.
-0 would be another matter. that is a distinct value. but I don't think those are included.
Truee getting tired of pasing the test then when trying to attemp it suddenly has different conditions provided. +0 is not included in the test only 0.
Codewars problems are now not that good and properly made. I always get this unexplainable condition added at the end of testing.
move the zeros to dart
Translation Dart
too easy, it should be 7 kyu
I was using Python. I passed it already. Thanks for your help though.
Loading more items...