• Custom User Avatar

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

  • Custom User Avatar

    seems redundant ...

  • Custom User Avatar

    because it says "write to the binary string and return it":

    • that is the given string
    • it has been pre-allocated
    • write to it
    • return it
    • profit
  • Custom User Avatar

    I dont understand why it returns "You must return a given string" when i allocate memory in the variable "binary" I did the same but without allocating memory and it works, why?

  • Custom User Avatar

    Please just forget the IDE, work only with the kata on the codewars site.

    You do not need to, and thus should not, allocate memory. It has already been allocated for you in the provided pointer.

  • Custom User Avatar

    I allocated memory in * binary and I store the bits on it and the last line of the fucntion is return binary
    thats all, i dont know why there is always an error or a bug in my code that doesnt seem to have an explanation, C language has been a pain in my head, sometimes the IDe doesn even print the expected result and nothing happens, I have to search deep for some answers before knowing what is the problem.

  • Custom User Avatar

    I have not seen your code, but you must not be returning the provided char *binary from the declaration. The idea is to write TO *binary and then return that from the function... whether or not your code works on another IDE is meaningless if it's not set up the same as on codewars.

  • Custom User Avatar

    Hello I am trying to solve this kata but it gives me this error

    "You must return the given string"

    apparently everything works fine because I tested the code in other IDE bit I dont know what i am doing wrong, help me please

  • Custom User Avatar

    because of the very next line(s) of code

  • Custom User Avatar

    why to declare newarr as a NULL the first lines if there will be memory allocated in it?

  • Custom User Avatar

    hello, how does it work?
    what kind of wicthcraft is this?

  • Custom User Avatar

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

  • Custom User Avatar

    If you haven't solved it yet, you don't need to learn much for this. It's just about creating a good algorithm

  • Custom User Avatar

    It iterates over the string only once instead of three times, making it much faster.

    If you aren't concerned with speed or space, the short code is nicer imo, since it's readability is better.

  • Custom User Avatar

    why is it better?

  • Loading more items...