I changed one line to make it work faster.
From the "best" score I was worse than it by 150 or something. Not that I care really.
From the "best" score I was worse than it by 150 or something. Not that I care really.
http://www.algolist.net/Algorithms/Binary_search
This is my original answer! I should not sort the input list though since it's not necessary.
But is string.indexOf() will be even faster?