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 comment is hidden because it contains spoiler information about the solution
On further experimentation, there are definitely JS test cases which expect the output to be
-0
when both the multipland and multiplier are positive numbers.In one random test case, for example,
n
(the multiplicand) is291
and the first integer in the array (the multiplier) is0
. The test is failing because it says that the result of that first multiplication is expected to be-0
.If we could expect all such cases (where the multiplicand and multiplier are both positive) to result in a negative zero for some reason, then fine: we could work around it sensibly. But not all the test cases expect negative zero in this "positive times positive" scenario.
Right now, this kata as described seems unsolvable in JavaScript. Perhaps the description needs updated if there is some implicit requirement for returning negative zero in certain conventionally-unexpected cases. But more likely, there is a bug in the test solution.
Why are we still getting -0 in the "expected" results in this kata, particularly in JavaScript?
It's not even conventionally possible to check for -0 in JavaScript using operators, Math.sign(), or the rest of the Math library, as far as I can tell. You can't even use right-shift to find that.
(I can find two ways to do it, but they are both highly obscure and one of them appears to be undocumented. I will mention them in a comment below with a spoiler tag for those interested.)
Deprecation warning in Rust (tests use an outdated function):
C++ Translation.
[Java] At least in the java fixed test the case where the pattern array is empty is not contemplated. So when you attempt the random tests you may pass the kata without checking that condition.
Just realize i misunderstand the phrase
the first in order of appearance
Example case: BAABB
If you think B is first in order of appearance, it's wrong.
A is correct answer. It can paraphrase 'the first in order of appearance which have highest length`
Expected
<kata.Result>: {C: 0, L: 0}
to equal
<kata.Result>: {C: 98, L: 1}
what about this corner case ?)
in my tests it works ok when im trying to put only 1 character
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Rust: no random tests
Python new test framework should be used
JS: Should use Node v12 and the approriate assertion tools (mocha + chai).
This comment is hidden because it contains spoiler information about the solution
Python new test framework should be used and 3.8 enabled
Loading more items...