|
5 | 5 | importjava.util.Collections;
|
6 | 6 | importjava.util.List;
|
7 | 7 |
|
8 |
| -/** |
9 |
| - * 1065. Index Pairs of a String |
10 |
| - * |
11 |
| - * Given a text string and words (a list of strings), |
12 |
| - * return all index pairs [i, j] so that the substring text[i]...text[j] is in the list of words. |
13 |
| - * |
14 |
| - * Example 1: |
15 |
| - * Input: text = "thestoryofleetcodeandme", words = ["story","fleet","leetcode"] |
16 |
| - * Output: [[3,7],[9,13],[10,17]] |
17 |
| - * |
18 |
| - * Example 2: |
19 |
| - * Input: text = "ababa", words = ["aba","ab"] |
20 |
| - * Output: [[0,1],[0,2],[2,3],[2,4]] |
21 |
| - * Explanation: |
22 |
| - * Notice that matches can overlap, see "aba" is found in [0,2] and [2,4]. |
23 |
| - * |
24 |
| - * Note: |
25 |
| - * |
26 |
| - * All strings contains only lowercase English letters. |
27 |
| - * It's guaranteed that all strings in words are different. |
28 |
| - * 1 <= text.length <= 100 |
29 |
| - * 1 <= words.length <= 20 |
30 |
| - * 1 <= words[i].length <= 50 |
31 |
| - * Return the pairs [i,j] in sorted order (i.e. sort them by their first coordinate in case of ties sort them by their second coordinate). |
32 |
| - * */ |
33 | 8 | publicclass_1065 {
|
34 | 9 | publicstaticclassSolution1 {
|
35 | 10 | publicint[][]indexPairs(Stringtext,String[]words) {
|
|