vitation for Applicat X loterview RoomFiltered X + capp.filtered al/interview/room/6118322091697bbest23a7c831c82178062a5bd401200d62ffd4e62fe0f5a9 3 a Javascript Nodejs 12.14.0 Input First line contains the String containing all the words Second line contains the first word Third line contains the second word Output Print the number of words to traverse from the first input word to reach the second input word within the input string see sample Input/output) 1 2 3 4 5 6 7 8 9 10 11 process.stdin.resume(); process.stdin.setEncoding("asc11"); var Input Data = "" process.stdin.on("data", function (chunk) { InputData chunk; >); process.stdin.on("end", function () { **// Do not editi Output the solution to the console. const output writeOutput(inputData); console.log(output); >>> 13 either of the two words are not present in the string, print Code evaluation is based on output, please do NOT print anything else 14 15 16 17 18 19 20 // Filtered is using the nodejs.v8 engine to process JavaScript. Please write your code = block below. // Our grading criteria is based on streas output, please return your output to log your function writeOutput(inputData) { // start writing code here to consume-input, and return result. return-InputCata; > Samlet The quick brown fox jumps over the lauick Loty PORNO Console Console Javascript Question 4/4 'Two words in a Document" Your solution will be scored against some number of hidden test cases. A sample is provided below. Time limit 90 minutes process.sto process.sto var-inputoa process.sto inputoa Given a large string of words and any two given words, write a program to find the smallest number of words to traverse from the first word to reach the second word in the given string (in either direction) For example, from one word to the adjacent word in the string, you traverse one (1) word. Assume the words are case sensitive 1 2 3 4 5 6 7 3 9 10 11 12 13 process.std --//-Don const o console "); 11 Filtered block-below IT-Our-grad! 14 15 16 17 18 19 20 functionar pll-Star preturns Input First line contains the String containing all the words Second line contains the first word Third line contains the second word Output Point the number of words to traverse from the Viestipur word to reach the second input word ) waren we mursuing see sample lopulloutput) Weither of the two words se not present in the ST