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.
C language: my code is running smoothly on the terminal, giving right results, but on kata, right on the second sample test I get the following error:
Test Crashed Caught unexpected signal: SIGSEGV (11). Invalid memory access.
Another interesting behaviour is that I passed 108 tests when I attempt, being 100/100 from "random tests" and 7/7 from "futher", and 1 sample.
I'm probably messing up with dynamic memory allocation. But since it works on terminal, I don't know what is it.
Question: why don't you have to call variable
p
before using it?Thank you very much, that solved the problem.
C language: I don't have much experience in C, so I feel the code is badly written and I'm messing with the dynamic memory allocation.
Tried, and passed the 4 tests. But, when I attempt, I pass 3 tests and then get the error message "Test Crashed
Caught unexpected signal: SIGSEGV (11). Invalid memory access."
Observation: the only dynamic memory that is not freed is the return varible, since they tell that the function result will be freed. All the other dynamic memory allocated are freed in each iteration.
Can anybody give me a hint on where I'm messing this up? In the mean time, I'll try to do a non-iterative version.
Thats great! I solved the problem turning 'i' into unsigned int. Thank you very much =)
C language: passing tests, but when attempting I get the "Execution Time Out", and only around 10 tests passed. Using recursive function as requested, any hypothesis as why thats happening?