text, made of words separated by single spaces, and two words first and second.
Find every place where first is immediately followed by second and then by one more word. Return those third words in the order they appear in the text.
Occurrences of the pair may overlap.text="the cat sat on the cat mat and the cat ran", first="the", second="cat" → ['sat', 'mat', 'ran']
The pair "the cat" occurs three times, followed by "sat", "mat" and "ran".
text="go go go go", first="go", second="go" → ['go', 'go']
Pairs may overlap: "go go" starts at words 1 and 2, and each is followed by "go". The pair at words 3–4 is last, with nothing after it.
text="one two three", first="two", second="three" → []
text="the cat sat on the cat mat and the cat ran", first="the", second="cat"
['sat', 'mat', 'ran']
Run checks the first 3 tests in your browser. Submit checks all 101 tests on the server, hidden ones included.