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 is brilliant!
Both clever and best practices, as it is handles everything efficiently, without doing splits of the string or applying reverse functions. Also, the way the spaces are added back to
result
and the final\0
is inserted is amazing!How does one learn these mathematically optmized, clever algorithms? Mine was recursive, which has O(n) time complexity. Yours is O(1), which is amazing!
Thanks a lot for the explanation <3.
I see a lot of challenges are mathematical stuff. If one doesn't realize the math concept behind it, one may take a long time guessing stuff, getting nowhere, or doing a poor job with the solution.
I believe, for instance, that this very problem is related to Arithmetic Sequences and Sums.
This comment is hidden because it contains spoiler information about the solution
What is the name of the concept or subject that this question exercises? What could one read about to be able to solve this?