Did you read my code? I already turned your second-level linear search into
a simple hash lookup. From a O(N*M) operation to a O(N) operation for N categories,
M names per category.
And then, I'm memoizing that, so it's speed up on any subsequent hits!