4 ms·
Similarly you can precompute a dictionary for the Cartesian product of the dictionary with itself, then lookup into that. Big in space but O(1) (wrt word len a
by hhmc 3y ago
Similarly you can precompute a dictionary for the Cartesian product of the dictionary with itself, then lookup into that.
Big in space but O(1) (wrt word len at least)
- abtinf 3y agoExcellent point. The only way to evaluate if this is a good or bad solution is the actual operational context. If you had a service that had to do millions of these matches per second with low latency, then this might be a reasonable solution.