The confusion arises because the word best can be used as any of several different parts of speech.
On the linked page, best is used as an adverb,
modifying the verb knew.
In that context, the phrase the best can also be used as if it were an adverb.
The meaning is approximately the same in that case.
In the following sentence, however, best is an adjective:
"What was best?"
If we insert the word the, we get a noun phrase, the best.
You could certainly declare that after comparing a number of things, you found that a particular one of those things was the best.
That is to say, it was better than any of the others.
So if you knew someone who had tried going up, going down, going left, and going right, you could ask them for their evaluation of the relative benefits of each of those actions: "Which was the best?"
(Note that I would say which rather than what.)
Assuming that the passage in the question is about the thinking of someone who is faced with choosing a course of action to take, not evaluating the outcome of an action already taken, I would use best as an adjective.
What was best? To go left or right, up or down?