Thanks, B1ts, very helpful. I think I misinterpreted the compiler message. I thought that the first string of numbers was the input. I read "equal" as "return".
Obviously I have to optimise the code a little further...
I'm too weak, this question is too strong... I can't solve this medium problem... How can I be a real engineer? How am I going to get into google?? KUSOOO :(
I would believe the problem is on your side. Are you sure you return a dynamically allocated buffer every time?
If you cannot find the problem with your solution, you can post it here (remember about code formatting and spoiler flag!), so we could check it.
In C the Attempt shows an error: Test Crashed Caught unexpected signal: 6
STDERR says: free(): invalid pointer
I think it would have passed all test because there was no assert errors and there was a bunch of Test passed text so can't Attempt till this error is solved :(
the problem comes from your code, you are not setting the
tree_size
to0
for an empty treeThis comment is hidden because it contains spoiler information about the solution
Thought thare was a C version to play with it since I solved the first one, so I guess I have to wait
Thanks, B1ts, very helpful. I think I misinterpreted the compiler message. I thought that the first string of numbers was the input. I read "equal" as "return".
Obviously I have to optimise the code a little further...
You haven't shown us what the "random input" is. The first one is your returned result, the 2nd is expected one.
See: https://docs.codewars.com/training/troubleshooting/#print-input
This comment is hidden because it contains spoiler information about the solution
I'm too weak, this question is too strong... I can't solve this medium problem... How can I be a real engineer? How am I going to get into google?? KUSOOO :(
I would believe the problem is on your side. Are you sure you return a dynamically allocated buffer every time?
If you cannot find the problem with your solution, you can post it here (remember about code formatting and spoiler flag!), so we could check it.
In C the Attempt shows an error: Test Crashed Caught unexpected signal: 6
STDERR says: free(): invalid pointer
I think it would have passed all test because there was no assert errors and there was a bunch of Test passed text so can't Attempt till this error is solved :(