Given text and a word, return text with every occurrence of word replaced by a run of asterisks of the same length. Matching is exact and case-sensitive; word is never empty. Occurrences are found from left to right and never overlap: after a match, the search continues just after it.
Examples
Input: text = "darn it, darn!", word = "darn"
Output: "**** it, ****!"
Input: text = "hello", word = "xyz"
Output: "hello"
Input: text = "baaad", word = "aa"
Output: "b**ad"
Explanation: "aa" is found at index 1; the search continues at index 3, so the overlapping "aa" at index 2 is not a match.
Constraints
0 <= len(text) <= 50001 <= len(word) <= 20- both may contain letters, digits, spaces and punctuation
Goals
- Replace every occurrence of a substring
- Build a replacement of the right length with `*`