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.
Sorry, what's the point of this comment? Why are you claiming the solution isn't feasible while it clearly is (as evident by it having passed all test cases) and telling us to do the auditing instead of giving the measured performance backing your claims? Your code provided in this comment isn't even a good way to benchmark - see Vyacheslav Egorov's presentation on performance and benchmarking to learn more on how performance tests can be useful but are prone to inaccuracy especially when ignoring engine optimizations.
(benchmarked and averaged over 100 unique instances of nodejs)
This code runs faster than even your own code submitted for this kata, which yielded the following benchmarks (also averaged over 100 unique instances of nodejs):
While this solution is easier to implement (which is genius, to be honest), it's not feasible based on time complexity.
You can use this code to compare this function with other implementations for comparison: