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.
woohoo
cool recursion worth my learning
It does the trick but there are some really concise solutions here with a fraction of the upvotes...
learnes a big lesson
Nice way to evaluate the arr is not empty or None.
L comment I won't lie
everything was much easier than I thought at first
It can also be None according to the kata description, which would then return None and fail.
This comment is hidden because it contains spoiler information about the solution
Hey, I am still learning c and was wondering if you could use sprintf instead?
Ha, didn't know about asprintf(), and overlooked it when looking at snprintf() manpage, thanks!
Old comment, but if someone runs into a similar issue - are you returning an array of the values or just the values?
My first attempt returned 10,-65 instead of [10,-65] for the first example problem, which fails.
It is actually a very good solution because asprintf stops potential buffer overflowes.
Further read: https://stackoverflow.com/questions/12746885/why-use-asprintf-instead-of-sprintf
in the ASCII table you will find '\0' is equal to the demical '0'.
*buffer = 0; is equivalent to *buffer = '\0'
Oh not bad using if not
I never thought we could do that
Loading more items...