Problem 616 · Medium

Add Bold Tag in String

Wrap every occurrence of the given words in bold tags, merging overlapping or touching ranges into one tag. The visual marks match intervals on the string and combines them into the fewest bold spans.

Open the interactive visualisation