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 one is wrong for 0.
Changed. Please recheck.
The array doesn't need to be local to the function. Consider making it static.
Character contents are being copied first to the strings in the array, then again to the returned string. Consider making the array consist of const char * instead.
Even though I prefer a branchless solution, this code is great to let the compiler optimise things. Good job.
+1 for making it branchless.
All the other stuff... like making new arrays on the fly at each call... not so good.
This comment is hidden because it contains spoiler information about the solution
MOD is normally compiled as IMUL, a very expensive operation (consider using & instead).
At a conceptual level, there is no need to introduce branching with operator ?. Consider an array subindex.