Use memoization, do not precompute pairs.  win