How would you go about doing that? These have to be able to appear anywhere in the username.
Would you get a hash for every possible series of characters in the username, and see if any of those hashes appear? That's only really going to be efficient if the number of banned names is very large.
2
u/[deleted] Oct 07 '21
You could just put the banned names in a hashset and look them up in O(1)