1078. Occurrences After Bigram
Содержание
class Solution:
def findOcurrences(self, text: str, first: str, second: str) -> List[str]:
words = text.split()
res = []
for i in range(len(words) - 2):
a, b, c = words[i : i + 3]
if a == first and b == second:
res.append(c)
return res