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.
Could you try my code: https://www.codewars.com/kata/reviews/557bdf248b12b34231000042/groups/66abc1d9dfbb6d7a3e76d0c4
I'm not sure how you check speed, but I think it should be faster than either.
I think this should be faster than all the top rated answers. O(logn) instead of O(n). Not sure how to check, would be curious if someone could validate.