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.
You can replace
win === true
withwin
because win is already a boolean
Please use spoiler flag next time.
This comment is hidden because it contains spoiler information about the solution
of course, i expected sth like this.
100% agree.
No, it's not flawed, but rather your solution did not pass because you mutated the input array. Mutating the input object is never a good practice anyway (undocumented side effects are just bad bad bad), so you have nobody but yourself to blame for this.
By the way, seriously, I really don't want to play Codewars Fun: Arrogance every day. It's frustrating.
No, it's just that you mutated the input array inside the
map
method (intArr[i+1] = a;
), which is an extremely bad practice in the first place anyways (side-effect in a supposedly pure function?).If you assign the result of the whole
map
to a new variable thenconsole.log
the original array again, you'll see why it's a problem.You should not mutate the input array.
The random test for this kata are flawed, at least in JavaScript. They want returned numbers that aren't even in the original arrays when you console.log. I can get the answer that it says is correct, but it is absolutely NOT correct. The JavaScript part for this should be pulled until it is fixed. Someone else has noted this about 10 months ago and it still isn't fixed.
It's still flawed. It's still doing the same thing.
This is not a level 7. It should be a level 6 at the lowest.
Instructions say to check for active students. IsActive is a boolean value per the description. Unfortunately, you can't simply test for true or false in the standard way. Flawed kata. Should either be reworked or removed.