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.
I did a while loop in for loop, but I kept getting time out...
you do not allocate enough memory.
count
is the length of the input array, i.e. the number of strings. your string will always require more memory than that, for example if you join"ab"
and"def"
you need 2 ("ab") + 1 (space) + 3 ("def") + 1 (nul terminator) = 7 bytes. you need to calculate the correct buffer size before allocating memory.So does it mean I can never solve this problem?
Did you test your solution on your machine with an array which has only one element?
Did you test your solution on your machine with
NULL
?I kept getting this "Caught unexpected signal: SIGSEGV (11). Invalid memory access."
but when I test in my computer, it works
This comment is hidden because it contains spoiler information about the solution
I mean if it's just for code that'll do
This comment is hidden because it contains spoiler information about the solution
In C, you should allocate your answer properly, there won't be any problem with it