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.
asprintf()
is a Linux function, not in standard C or POSIX. you must either declare it manually, or#define _GNU_SOURCE
before you#include <stdio.h>
The tests free it. It's always the case when you must return a heap allocated array / string (you cannot free it yourself: where would you? After return, the statement is not executed, before return then you would return a pointer to something not allocated anymore).
Why is the memory pointed to by r not released at the end of the function
Nice! something to consider would be scanning the two arrays separately first to find the shortest and longest string, and then doing the comparison after.