Given three strings text, first, and second, find every word that immediately follows an occurrence of first followed immediately by second.
Return an array containing all such words in the order of their appearance in text.
Constraints:
text.length
text consists of lowercase English letters and spaces.
All the words in text are separated by a single space.
first.length, second.length
first and second consist of lowercase English letters.
text will not have any leading or trailing spaces.
Given three strings text, first, and second, find every word that immediately follows an occurrence of first followed immediately by second.
Return an array containing all such words in the order of their appearance in text.
Constraints:
text.length
text consists of lowercase English letters and spaces.
All the words in text are separated by a single space.
first.length, second.length
first and second consist of lowercase English letters.
text will not have any leading or trailing spaces.