Thank you
when n == 0 you are returning a string literal that cannot be passed to free(). only heap-allocated pointers can be passed to free(), this is why your function crashes.
n == 0
free()
in Java, the function you have to write is a variadic function: it takes a varying number of parameters. Research how variadic functions work in Java
you print the result instead of returning it
One of your branches still does not return anything.
I did that but no result.
because you need to return the value, not print it
my code works fine on other IDE but in the code warroiors enviroment it says incorrect output why this happnes ,FYI I use JS.
test your solving on small samples.
It is not a valid kata suggestion.
This comment is hidden because it contains spoiler information about the solution
Loading collection data...
Thank you
when
n == 0
you are returning a string literal that cannot be passed tofree()
. only heap-allocated pointers can be passed tofree()
, this is why your function crashes.in Java, the function you have to write is a variadic function: it takes a varying number of parameters. Research how variadic functions work in Java
you print the result instead of returning it
One of your branches still does not return anything.
I did that but no result.
because you need to return the value, not print it
my code works fine on other IDE but in the code warroiors enviroment it says incorrect output why this happnes ,FYI I use JS.
test your solving on small samples.
It is not a valid kata suggestion.
This comment is hidden because it contains spoiler information about the solution
Loading more items...