OP solved it, closing
Your code doesn't work when there are negative numbers in array1. Your variable nuevo becomes unordered.
array1
nuevo
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
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:
warning: address of stack memory associated with local variable 'result' returned [-Wreturn-stack-address]
ty, the print was the problem
i added instructions and a call to free() in this fork
free()
Please see this paragraph.
Loading collection data...
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