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.
Your answer is in this paragraph of FAQ: https://docs.codewars.com/training/troubleshooting#c-c-signal-11---sigsegv
It's not exactly your solution segfaulting, but it causes tests to crash.
But it doesn't. That code is inside the condition
if (*p == ' ' || *p == '\0')
Yes. p is the space or null terminator, so that
p-1
is the last char of the previous word.