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.
Very good kata !
there is no need to change the original formula to solve the problem...
Added
This comment is hidden because it contains spoiler information about the solution
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.it works after using len of needle as sizean array instead of using malloc , but I wonder why , should be the same thing ;
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:
I used C
it's case insensitive , and there's a 'q' ,
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?
random test dont verify well ,
("jQoDqHaPXXYcTnORAxBbZRmNK" , "JQoQapXxCnrXbBZMk") should be true , I test the program in my local ide and got true , but in the random test I got false ;
Thank you for the changes and prompt reply!
Loading more items...