3 ms·
That isn't a very efficient way to do it. Try doing a binary search. Start with a word that starts with 'M', then if it's before, try one that starts with 'F' o
by Hasu 11y ago
That isn't a very efficient way to do it. Try doing a binary search. Start with a word that starts with 'M', then if it's before, try one that starts with 'F' or 'G', if it's after, try one that starts with 'S' or 'T'. You eliminate roughly half the possible words with each guess that way, and you'll get to your answer much more quickly than guessing in alphabetical order.
You could improve this method by finding out where the exact midpoint is in the list of words by alphabetical order, as I'm not certain it's actually halfway through the alphabet.
And I'd bet that some people here on HN could come up with even cleverer ways to cut down on guesses.