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.
thanks a lot!
infinite loop if there is no
'o'
no real random tests, integer overflow, input
char *
notconst
-qualified. all fixed, but I could not modify the prototype without invalidating previous solutions, so there is no way for the user to report his array's lengthseveral things wrong here: if there are no
'o'
in the input, you derefencemalloc(0)
, this is UB; you also assume thatmalloc()
will return zeroed memory, this is not always trueyou mistakenly wrote
result++;
while you probably meantnum++;
.result
is anArray
and using the++
operator on it converts it to aNumber
, andNumber
s do not have apush()
method.fixed
fixed
added random tests in C that will never generate an
int
overflowThis comment is hidden because it contains spoiler information about the solution
Corrected with a fork and approved
I know how to code but couldn't understand what's the relation with dead fish. Can anyone explain that?
Your algorithm for counting the divisors is very inefficient.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
I've posted my code just now. I've tried to write a function to get divisors already.And I also tried for loop.It's just no use.I have no idea now.
Loading more items...