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.
Unfortunately, it is too slow. What about real DB, for example, 100 000 items? I think here we need something with O(log(n)). Maybe something like this: https://www.codewars.com/kata/reviews/56024ec67903d24c8e00002d/groups/57860f9522542afb0b0001d1
This solution a bit faster then simple array looping. With 100 000 items:
simple loop: 75.1681 sec
this one: 0.025 sec