문제 링크 : Occurrences After Bigram
/**
* @param {string} text
* @param {string} first
* @param {string} second
* @return {string[]}
*/
var findOcurrences = function(text, first, second) {
const textArr = text.split(' ')
let result = []
for(let i=2; i<textArr.length; i++) {
if(textArr[i-2] === first && textArr[i-1] === second) result.push(textArr[i])
}
return result;
};