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.
OP solved it, closing
Your code doesn't work when there are negative numbers in
array1
. Your variablenuevo
becomes unordered.Check out the troublehooting link from my previous post.
This comment is hidden because it contains spoiler information about the solution
Without formatting, your code is unreadable :/
Try to format it like it's shown here: https://docs.codewars.com/references/markdown/#code-block
You could also check which input causes the failure, see this post: https://docs.codewars.com/training/troubleshooting/#print-input
This comment is hidden because it contains spoiler information about the solution
OP solved the kata (while still returning a stack array from the function, remarkably)
OP solved the kata
OP solved the kata + problem not reproducible with his solution
you return the address of a local (stack-allocated) array, as the warning tells you:
ty, the print was the problem
i added instructions and a call to
free()
in this forkPlease see this paragraph.
This comment is hidden because it contains spoiler information about the solution