|
3 | 3 | importjava.util.stream.Collectors;
|
4 | 4 | importjava.util.stream.IntStream;
|
5 | 5 |
|
6 |
| -/** |
7 |
| - * 5083. Occurrences After Bigram |
8 |
| - * <p> |
9 |
| - * Given words first and second, consider occurrences in some text of the form "first second third", |
10 |
| - * where second comes immediately after first, and third comes immediately after second. |
11 |
| - * For each such occurrence, add "third" to the answer, and return the answer. |
12 |
| - * <p> |
13 |
| - * Example 1: |
14 |
| - * Input: text = "alice is a good girl she is a good student", first = "a", second = "good" |
15 |
| - * Output: ["girl","student"] |
16 |
| - * <p> |
17 |
| - * Example 2: |
18 |
| - * Input: text = "we will we will rock you", first = "we", second = "will" |
19 |
| - * Output: ["we","rock"] |
20 |
| - * <p> |
21 |
| - * Note: |
22 |
| - * 1 <= text.length <= 1000 |
23 |
| - * text consists of space separated words, where each word consists of lowercase English letters. |
24 |
| - * 1 <= first.length, second.length <= 10 |
25 |
| - * first and second consist of lowercase English letters. |
26 |
| - */ |
27 | 6 | publicclass_1078 {
|
28 | 7 | publicstaticclassSolution1 {
|
29 | 8 | publicString[]findOcurrences(Stringtext,Stringfirst,Stringsecond) {
|
|