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.
Now you have buffer overflow in your solution.
Also your
malloc
and the stack-based array are not the same. The thing you malloced was not properly null-terminated (even though it had a null-terminator at the end) and contained trash which tripped thestrcmp
up.Your solution is buggy in more than one way. The things you pass to
strcmp
are incorrect.You also do not free the malloced memory.
And why even malloc any memory, this problem can be solved with no additional buffers :)
Please post your code following this: https://docs.codewars.com/training/troubleshooting#post-discourse
My bad, it looks like you were right there. Couldn't do this on the phone:
Where do you see that second Q in the first string? Not a kata issue.
P.S.: shouldn't reply without being totally awake.
In what language? What is your code?