Given an array of strings words and a string s, wrap all occurrences of any substring in s that appears in words with <b> and </b> tags.
If two or more bolded substrings overlap or are directly consecutive, they should be merged and enclosed within a single pair of <b> and </b> tags to minimize the total number of tags used.
Return the resulting string after bolding all matching substrings.
Constraints:
s.length
words.length
words[i].length
s and words[i] consist of lowercase English letters.
Given an array of strings words and a string s, wrap all occurrences of any substring in s that appears in words with <b> and </b> tags.
If two or more bolded substrings overlap or are directly consecutive, they should be merged and enclosed within a single pair of <b> and </b> tags to minimize the total number of tags used.
Return the resulting string after bolding all matching substrings.
Constraints:
s.length
words.length
words[i].length
s and words[i] consist of lowercase English letters.