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.
the error comes from your code: wrong index calculation, so you access invalid memory
should be:
(you forgot the + 1 for the nul terminator, and you got the pointer arithmetic wrong:
ptr + n
will addn * sizeof *ptr
toptr
, so you were going out-of-bounds ofpins
. The cast tochar *
needs to happen right away, in order to have byte-level memory access.)as already reported here,
actual
andexpected
are flipped all over the place in the tests suitethis would invalidate all current, valid solutions to a blue kata and require editing of all four languages, just for a cosmetic change. Why should we do that ?
the description could mention that it does not matter whether our path is open or closed (a closed tour is one in which the knight can reach the starting position from the final position)
at the bottom of the documentation for Order(), it is written:
checking .NET version on Codewars:
fixed
are you sure that the test cases you print are those you fail ? I suspect that you were printing the island after having mutated it. I tried your code and it always fails the random tests in the same fashion: the starting point contains some gold (
$
) and it seems like you fail to collect it, so you have an extra step that you should not have:I'm closing as the issue seems to be coming from your code. Feel free to present more information.
there was a bug in the random tests, due to careless division that could yield a NaN when the length of the array is
0
. can you check if it is good for you know ?Trying to solve this in C#... Simple brute method worked with sample tests, but timed out on the later test.
So i've used the Binet formula which works fine up to n = 10 and fails at n = 100.
I've used double to define phi, psi and sqrt(5), and to do phi^n, and apparently that starts to fail in lesser digits on the number.
What am I missing here?
this issue is not reproducible - the kata is currently solvable. this is likely due to changes in the Node.JS environment / code runner setup for JS on Codewars (perhaps because Babel is no longer used - though I cannot replicate the issue even with the old
Node v8.1.3/Babel
version. But it would still be solvable even without that specific feature.this issue is not reproducible.
works fine for this kata
added in C
How did you loop different numbers into the array where you added to find the different lengths?
Added in Haskell ( first random test will always be
0
).Haskell has the same situation. Less than ideal design, though I would not argue in favour of changing it now.
Is it useful to keep this open?
Loading more items...