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.
Try at least 50 random tests. If it's good, then bump to 100.
Beleive me, in almost all cases it will not take much time at all
That's why you need a good reference algorithm - to handle unforeseen combos. :P
Two is still a bit sparse; it should be no problem to generate a hundred. Unless there are reasons why it's hard to geenrate random testcases, but I don't see why that should be so. ( Open to being enlightened though. )
The idea is good! The execution needs some work yet.
It is probably easier to just rewrite the expression every time instead of trying to change it for your hypothetical legacy support case.
Returning an empty array for both a valid solution and an impossible solution seems weird, but the shave with axe thing makes me forgive you this wholeheartedly.
Thank you for this kata! :]
Your solution does not work is the number is 10;
Good to hear that :)
Yeah, that comment isn't clear. This solution wouldn't be able to handle cycles where the second node in the cycle is before the first node in the cycle in the initial list (the reverse of the way it was in the test as it existed when I wrote the solution). The solution is fragile and bad because it breaks if the order of items in
processList
changes.This comment is hidden because it contains spoiler information about the solution
Thank you. Good point.
Fixed it. Thanks,
Great idea, but more than 500 people have completed this, so I can't edit it, sorry!