← Back to companies
[ OK ] Loaded —
[ INFO ]
$ cd
$ ls -lt
01
02
03
04
05
$ ls -lt
01
02
03
04
05
user@intervues:~/$
You are given a string text and a list of forbidden words forbiddenWords. Your task is to replace every occurrence of any forbidden word in the text with asterisks (*), where the number of asterisks equals the length of the forbidden word. Matches are case-sensitive and must be exact substrings. Implement a function censor(text: str, forbiddenWords: List[str]) -> str that returns the censored version of the text.