This comment is hidden because it contains spoiler information about the solution
Solved, I forgot to use the realloc function.
realloc
Ok, thank you.
Is my time complexity too high?
Yes, it is. You need an O(n) solution, not an O(n^2) one.
I think it is too high. There are some cases with really large numbers, with 1 for loop is enough.
Loading collection data...
This comment is hidden because it contains spoiler information about the solution
Solved, I forgot to use the
realloc
function.Ok, thank you.
Yes, it is. You need an O(n) solution, not an O(n^2) one.
I think it is too high. There are some cases with really large numbers, with 1 for loop is enough.
This comment is hidden because it contains spoiler information about the solution