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.
Thanks for the tips, I will look into the issues this evening.
Well, you chose C for this task, so any pain is warranted :P
With C it's important to read comments/description to see how you should present the result.
I only took a quick peek at your solution (after spending significant time myself trying to solve it, and suffering), and I noticed that you're assuming
result
is null-terminated at the beginning. It probably isn't, and contains garbage value, so when you try to concatenate another string, the result is not what you'd expect. There are probably other mistakes which I didn't investigate (for example, do you really need to copy the input sentence? What if it's longer than your number?)You can also make use of functions like
printf
to show intermediate values and help you debug the solution.And just keep in mind you are fully responsible for the memory management of
*results
to ge the right results.In C it's so painful.
Hint: The bash terminal might tell you that you're right, but the testing probably will not.
Don't waste time in compiling using a terminal and use the Codewars text editor instead. Terminal output most of the time doesnt mean anything.
I'm still trying to fix the result getting random characters at the end, even tho the terminal output is 100% correct.