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.
Rejected. No random tests.
;-)
Indeed! It's a standard way to return something useful and considered to be
BestPractices
!Here are some of string functions from the standard library that do it the similar way:
strcpy:
char *strcpy(char *dest, const char *src);
strcat:
char *strcat(char *dest, const char *src);
Consider this code:
And this one:
The first is more convenient and more compact especially if there are dozens of them...
Sure, there are better explanations and better applications than these ones!
didn't have that problem on my side... :o reset the kata (copy your solution before) to be sure that you didn't change something in the sample tests by accident.
no issue. You didn't think about some edge cases. Try printing in the console.
But I have to say, the description is quite poorly designed...
The argument types should be
const char *
since the strings shouldn't be modified. A better return type would besize_t
because the value is derived from object sizes.And there're no random tests, which is not good for a kata when the difficulty and estimated time of writing a real solution exceeds those of cheaty solutions.
np. Glad I could help!
I forked the translation because it wouldn't let me select a python version for some reason so tests wouldn't pass.
The tests should be fixed in the forked one :)
Yes whoops. I'll fix it. :P
That's due to your inefficient code. Not an issue.
Seems fine to me. Both are invalid. This one is just bugged. o_O
boredoms and donaldsebleung have discovered problems with this translation (see the discourse section).
I'm writing this here because I don't know if you got notified.
CodeWars
Generally you create a test where those invalid solutions will fail.
Here you need to create a test that will throws something like
segment fault
. Accessing to un-malloced address will not always break the system.I am not so familiar C so it is up to you.
You can
attemp
with this solution to see if it is actually banned.It is still valid judging by CW.
You need to make CW believe this answer is invalid
You can only translate a kata after you've solved/forfeited the kata.
Loading more items...