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.
It's very difficult, and in many languages not really possible to be done reliably. Kata which attempt such restrictions usually end up being very poor at enforcing them. The best approach is to avoid such requirements. There is no good, reliable way to test against them.
Thanks for your post and good luck with C:-)
Morality of the story: don't post issues too fast:-) It tooks me time to examine your solution:-(
Print your array "names" before your return. When I do that in your solution I get "Lily", "Elizabeth" and your return is ofc Elizabeth...
Try on your system not only that test but several tests in a row and you will see. Or add this test
at the end of the "Sample Tests". Your answer will anew be Elizabeth.
You returned Elizabeth.
As far as I know there is no problem in the testing since 67 guys passed the C kata. Moreover I tried a few solution and all worked fine.
Update:
You should read https://github.com/codewars/codewars.com/wiki/Troubleshooting-your-solution.
I just solved C version and after a bit of a hassle with edge cases, I got it to pass without problem. Make sure to correctly handle edge cases (leading zeros in input, overflow), recreate and debug failing cases locally, and you should be able to make it work.
I do not know if having no
free
was a part of your debugging or maybe intentional, but you probably cannot solve the kata without mallocing and eventually freeing a helper buffer, so "i have nofree
" is actually a symptom of a bug. Additionally, it says "... or corruption", and double free is not only reason for the error. It can be also a result of out-of-bounds writes (which I experienced).You are the real MVP.
Thanks for the hint.
I do think the author do this on purpose to simulate a unclear requirement problem faced everyday by programmers.
And if you points it out, he will pull the ole "xxx numbers of people passed the kata" crap. Boils anyones blood really.
I cant do most of his kata but I dont hate him.