Given a string s and an array of strings words, wrap all occurrences of any substring in s that appears in words with the bold tags <b> and </b>.
If two substrings overlap or are directly consecutive, they should be merged and enclosed within a single pair of bold tags.
Return the modified string after adding the bold tags.
Note: This question is the same as
: Bold Words in String.
Constraints:
s.length
words.length
words[i].length
s and words[i] consist of English letters and digits.
All the values of words are unique.
Given a string s and an array of strings words, wrap all occurrences of any substring in s that appears in words with the bold tags <b> and </b>.
If two substrings overlap or are directly consecutive, they should be merged and enclosed within a single pair of bold tags.
Return the modified string after adding the bold tags.
Note: This question is the same as
: Bold Words in String.
Constraints:
s.length
words.length
words[i].length
s and words[i] consist of English letters and digits.
All the values of words are unique.