Ad
  • 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

    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

    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

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

  • Custom User Avatar

    Ok, so you just can't write good random tests, and kata description. I get it.

  • Custom User Avatar

    There is issue with C++ translation in test4. m value is grather than n, so we should return "blank" string, but test expect different value.

    and this is only one situation when m > n. Even random tests pass n grather than m.

  • Default User Avatar

    I cant pass last random test in C.
    Test Crashed
    Caught unexpected signal: 6
    What does that mean ? Can i look at the randomtests?