Bold Words in String

Given a list of words and a string s, wrap every occurrence of every word in s with the fewest possible pairs of <b> and </b> tags. Overlapping and adjacent matches must be merged into one bold region. Return the tagged string.

Examples
Input: ["ab","bc","zabcz"]
Output: 3

Bold Words in String

Given a list of words and a string `s`, wrap every occurrence of every word in `s` with the fewest possible pairs of `<b>` and `</b>` tags. Overlapping and adjacent matches must be merged into one bold region. Return the tagged string.