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.
C# test suite generates a warning, and the preloaded
Node
class is missingGetHashCode
.Gripes with the description that I feel should be addressed:
The PHP random test cases are broken.
I know they're broken because I SOLVED IT!
drop-in hotfix included in this post! (down near the end)
Sorry if this is a litte long-winded, pretty new to this.
There are 2 core issues here:
A Fatal error within the random test-cases.
This was mentioned 2 years ago by another user.
I originally thought this was a memory leak due to some pile-up of
Node()
objects somewhere, but after more investigation this doesn't appear to be the case.This appears to correlate more heavily with the next issue. (though, it's hard to say exactly how?)
This can be avoided by creating new nodes rather than linking nodes. (
$node->next = new Node($other->data);
)Mangled inputs making the random tests effectively impossible.
This was mentioned 5 years ago by another user (the issue mentioning 'DEAD LOOPS' (I'm unfamiliar with the term, but I think they're correct?)).
The random test cases are re-using the previous solution for the next tests input.
These random tests appear to take the form of "append a to b, then append b to a" (in pairs), with the issue being that list_b for the alternate case will contain the previous solution instead of the swapped input.
This is possibly due to literally having swapped the input variables (after users have mutated them), instead of fully re-constructing them for the alternate test-case.
This can be worked around by using global variables to cache the previous inputs and outputs, to determine if one's been mangled, and restore the correct input.
Here are the functions, setup and teardown that made this kata possible for me. (I'm hoping this won't get spoilered, because I really have tried to keep it spoiler free).
There's almost certainly other ways to tackle this once you know how the bugs work, but this should (hopefully) be a decent drop-in hotfix:
I hope this helps someone out there!
I'm not really raising this issue looking to see a fix to a 5+ year long issue, people have lives to live, and I'm not looking to demand free work.
I just hope to make the purpose of this post clear and give others the chance to solve this kata, because I really have enjoyed the series so far! <3
I thought that Kata was pretty good, yet I cannot submit my solution or view test cases or spoiler comments without forfeiting eligibility. Is there a reason why it is now a draft again and not published?
The available tests do not cover all cases. it would be nice to add the test 'aabacacacacacacac'
Why is my code passing some tests but not passing some other tests?
Did I understand the question wrong?
what I understood is that I should remove all duplicates and that's what I think my code is doing
Python: No random tests
This comment is hidden because it contains spoiler information about the solution
python new test framework is required. updated in this fork
This comment is hidden because it contains spoiler information about the solution
JS (and possibly Python too): expected values and tests/assertions should not rely on any function in the scope of the user, especially not the implementation of
Node
.Python fork
ImportError
. This fork adds the required imports:from preloaded import push, assert_linked_list_equals, build_list
. The kata is currently unsolvable in Python unless one makes these imports in solution.CoffeeScript translation (language agnostic description)
CoffeeScript translation
CoffeeScript translation
Loading more items...