Easy · Trie · about 15 minutes
Asked at Amazon, Google, Meta.
Return every index pair [i, j] such that text[i..j] (inclusive) is one of words, sorted by i and then j.
[i, j]
text[i..j]
words
i
j