1065. Index Pairs of a String
https://leetcode.com/problems/index-pairs-of-a-string
Description
Given a string text
and an array of strings words
, return an array of all index pairs [i, j]
so that the substring text[i...j]
is in words
.
Return the pairs [i, j]
in sorted order (i.e., sort them by their first coordinate, and in case of ties sort them by their second coordinate).
Example 1:
Example 2:
Constraints:
1 <= text.length <= 100
1 <= words.length <= 20
1 <= words[i].length <= 50
text
andwords[i]
consist of lowercase English letters.All the strings of
words
are unique.
ac
Last updated