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.
same Problem :-()
This is a 6kyu kata, which is on the easier end. For harder kata, it's common to not let inefficient code pass (because there's a limited time in which all tests must finish, which is 12s for most languages). You can check the tags: Where efficient code is requested, the tags will often include 'performance'.
Because it isn't necessary? The thing is we are going to spend linear time generating the array anyway.
Binary search is the most appealing if you have a static sorted (in some way) array, and you need to search in it multiple times. If you are just going to search through it one for one thing, to improve efficiency you should probably consider how you can make the array a stream or something to avoid storing large number of values, or maybe how you can eliminate the array altogether.
The inefficiency you mentioned can be revealed if you directly measure the time took by the function... But apparently this was not done :) If you want to, when you get enough points, you can create your speed version of this kata. Make sure to do it well though, bad quality kata are not something really tolerated here.