Algorithm · Harvey · Medium
Problem You are given a text string document and a list of strings sources. Your task is to locate every occurrence of any source string inside document and wrap those occurrences in tags. A match occurs when a substring of document is exactly equal to a source string (no transformations or edits allowed). Multiple matches can exist, and they may overlap or be adjacent to one another. You must: Identify every match interval [start, end) (start inclusive, end exclusive).…
Checking your access…