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.
Without any information, we do not know either. Sorry.
I don't get it why my solution do not pass random test...
This kata is too easy for 6 kyu
Its because you are passing to target[i] pointer to const value and try to modify. Assign "some" memory on heap, copy context from y to this blocks and then do operations on this
This comment is hidden because it contains spoiler information about the solution
The initial solution setup uses a varargs parameter:
and these can be called either as
whoLikesIt("Alice", "Bob")
or aswhoLikesIt(new String[]{"Alice", "Bob"})
. So if you just keep the varargs everything works.For Java Users:
U need replace tests with this:
assertEquals("no one likes this", Solution.whoLikesIt(new String[] {}));
assertEquals("Peter likes this", Solution.whoLikesIt(new String[] {"Peter"}));
assertEquals("Jacob and Alex like this", Solution.whoLikesIt(new String[] {"Jacob", "Alex"}));
assertEquals("Max, John and Mark like this", Solution.whoLikesIt(new String[] {"Max", "John", "Mark"}));
assertEquals("Alex, Jacob and 2 others like this", Solution.whoLikesIt(new String[] {"Alex", "Jacob", "Mark", "Max"}));
Or use overload of method.
//Incorrectly specified input data for the task//
tbh in C language this is on right lvl. Not to complicated to design solution, but you should well know how dynamic memmory works.
Of course... Damn it.
Now it's works. Thank you.
I believe you're not allocating enough memory for the string (for example, check case 3 more closely).
Also I would recommend, to cast pointer type that you allocate. Calloc, Malloc, Realloc <- all of this returns void pointer type to allocated memory.
Hi gues,
All sample tests passes, but i have issue with random tests. Every time when i attempt, random test results is "Caught unexpected signal: 6"
I do not have any idea how to debug this and cannot find issue in my code. Can someone help me ?
I have three different STDERR:
"double free or corruption (!prev)" or "free(): invalid pointer" or "free(): invalid size"
Definitelly to easy for 5kyu
Ohh really sorry, my bad. I read wrong error msg.
The expected answer for that test is "volcano", not "climbing". That's a problem in your code, not a kata issue.
This comment is hidden because it contains spoiler information about the solution
Loading more items...