7 ms·
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.
by thezoid 13y ago
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.
- dclara 13y agoLooks like one simple change to hashmap may not be the best answer. May I draw the conclusion from your case like that? The best score now went up to almost 3000. I couldn't imagine how many possible ways out there and one of them could be that excellent. Just curious.
- platypii 13y agoSorted list + binary search was 2000pts and ran much faster than the hashmap solution.
- dclara 13y agoThank you so much for your info. This is something I'm looking for from the beginning of the discussion. http://www.algolist.net/Algorithms/Binary_search 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?