Big in space but O(1) (wrt word len at least)
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.