> For the complete documentation index, see [llms.txt](https://cai-sen-se.gitbook.io/leetcode/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cai-sen-se.gitbook.io/leetcode/1001-2000/1078.bigram-fen-ci.md).

# 1078.Bigram分词

[原题](https://leetcode-cn.com/problems/occurrences-after-bigram/)

用i，j，k三个指针一次遍历，每次各向前一位，当i和j分别与first和second匹配时，输出k指向 的字符

```python
class Solution:
    def findOcurrences(self, text: str, first: str, second: str) -> List[str]:
        s = text.split(' ')
        n = len(s)
        res = []
        if n < 3:
            return res
        i, j, k = 0, 1, 2
        while k < n:
            if s[i] == first and s[j] == second:
                res.append(s[k])
            i += 1
            j += 1
            k += 1
        return res
```
