I am currently doing some tests at Kattis to practice my node.js skills but I'm stuck with this one.
Below is my code:
const readline = require("readline");
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
});
rl.on("line", (line) => {
let inputData = line.split("/n");
console.log(inputData[0].length);
// result = (inputData[0].length) >= (inputData[1].length) ? 'go' : 'no';
// console.log(result)
});
..and in the console log inputData[0].length, I am getting:
4
6
When I used inputData[1]
, it gives me undefined. How can I compare these 2 lines so 'go'
or 'no'
will be displayed as the result?