3 ms·
I have dealt with this specific problem before and it is a quite difficult problem. I actually use it as an interview question often for prospective programmers
by SOLAR_FIELDS 8y ago
I have dealt with this specific problem before and it is a quite difficult problem. I actually use it as an interview question often for prospective programmers and it is a decent gauge of someone’s general problem solving abilities. If you ask this problem of any programmer generally the people who come up with the common “gotchas” and some suggested solutions quickly are the kind of people that are likely to be able to quickly solve problems in a pragmatic way generically.
The two most difficult parts of this problem are the subset problem and the localization problem.
The subset problem is highlighted by Scunthorpe. When looking for bad words, how do you whitelist the places like Scunthorpe where the subset can contain a bad word? I.E. how can we allow Scunthorpe while also disallowing .:)(B.adw0r3d ?
The localization problem is easily described in this thread as well. In French, ass might mean a completely beningn word that’s completely different from the meaning in English.
In the end the current solutions aren’t great and involve a shit ton of heuristics with a lot of human intervention. I don’t see that changing in the near future.