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.
This comment is hidden because it contains spoiler information about the solution
Probably because this was written many years ago, and there was no built-in implementation of
IntoIterator
for[T; 13]
at the time.that's right, check out the fork
yeah, how it is now doesn't match the description
Equal functions should result in False because some intersection points are outside the interval (unless the interval is all real numbers).
Yeah, how returning pointer to stack got top score in best practices is beyond me...
It is necesssary. C strings are '\0' terminated;
YMMV.
:D
snap !
Oka, since C99 yes, you can. But you can't define it:
int array[n]; // it's ok.
int array[n] = {0}; // this fails.
error: storage size of ‘newArray’ isn’t constant
You cannot specify the storage size of a static object at runtime.
The test cases for this kata do not
free
the returned memory - the only sensible option is to mutate the input (array
) and return it.Correct is never best practice to return a stack allocated variable.
This will fix it, that is unless you are threaded - as this isn't thread safe.
static int newArray[length];
And how is the string returned by your solution null terminated?
All C test strings have null terminators. Are you sure that your solution is correct? You may post your solution in a comment with a spoiler tag. Or you may ask questions here.