Design a data structure such that getWinner method runs in O(1) time.
Assume you call put(x, y, Player) for each move. Best space efficient solution wins.
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, see the FAQ.