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.
Also I don't get the FUD about using regex, they're not slow in general. Some regex can be slow, but one that looks for a single digit is as fast as indexOf.
Is there a way to make it O(n) without the use of regex?
This comment is hidden because it contains spoiler information about the solution
According to the spec, the numbers are in the range [1,9].
Looks like it reverses the whole string for each element in the output array. This would not be very efficient for large inputs.
This comment is hidden because it contains spoiler information about the solution