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.
I like your code. I understand it better than mine. But you don't save any pointer to the start of the memory allocated for 'r' and 'q', so you could never free this memory.
yes, I was wrong. I'm sorry bro )
long
maximum is platform-dependent. On CW it's 8 bytes, and if your solution failed, it's wrong.you have test case at least with 11 digit number, long maximum is 2^31, long long 2^63 (long's size in C 4 bytes), that is why i got some tests wrong but program was ok
Maybe you should tell why
long
must be replaced instead of saying "ha-ha something's gonna work"?Hi! I think you have some issue in input parameters of function in C language.
Now : bool loneliest(long n)
Should be : bool loneliest(long long n)
With long long it works correctly :)
To me this solution (and others alike) are the best. They are the only ones that cover the following case:
"10 shots and 2 beer". Most solutions give 3 (1 + 0 + 2) instead of 12 (10 + 2) as the result.