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.
First of all, please mind that this kata uses terrible requirements for its return value, which goes against common C practices. It's not something what you'd do in any kind of C code.
What you need to do is to return a dynamically allocated array, where each element of such array is a pointer to an individually, dynamically allocated
Pair
:Don't ask why it's done like this, and not just in a normal way of allocating all pairs at once:
If you still can't get it to work, i'd suggest asking for help on
#c
channel of Codewars Discord (and from the start explain what kata you work on, because initially people might not realize how twisted requirements here are), solve it in a higher-level language, or just leave this kata, ignore for now, and come back to it when you get better grasp of memory management in C.