Ad
  • Custom User Avatar

    Without any information, we do not know either. Sorry.

  • Custom User Avatar

    I don't get it why my solution do not pass random test...
    This kata is too easy for 6 kyu

  • Custom User Avatar

    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

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    The initial solution setup uses a varargs parameter:

    public static String whoLikesIt(String... names) {
    

    and these can be called either as whoLikesIt("Alice", "Bob") or as whoLikesIt(new String[]{"Alice", "Bob"}). So if you just keep the varargs everything works.

  • Custom User Avatar

    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//

  • Custom User Avatar

    tbh in C language this is on right lvl. Not to complicated to design solution, but you should well know how dynamic memmory works.

  • Custom User Avatar

    Of course... Damn it.
    Now it's works. Thank you.

  • Custom User Avatar

    I believe you're not allocating enough memory for the string (for example, check case 3 more closely).

  • Custom User Avatar

    Also I would recommend, to cast pointer type that you allocate. Calloc, Malloc, Realloc <- all of this returns void pointer type to allocated memory.

  • Custom User Avatar

    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"

  • Custom User Avatar

    Definitelly to easy for 5kyu

  • Custom User Avatar

    Ohh really sorry, my bad. I read wrong error msg.

  • Custom User Avatar
    Assert::That(highestScoringWord("what time are we climbing up the volcano"), Equals("volcano"));
    

    The expected answer for that test is "volcano", not "climbing". That's a problem in your code, not a kata issue.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Loading more items...