GUVI
Back

Help me with this code

Created 2 years ago
66 Views
2 Comments
Nitheshkannan
@Nitheshkannan
Nitheshkannan
@NitheshkannanProfile is locked. Login

const readline = require("readline"); c

onst inp = readline.createInterface({ input: process.stdin });

const userInput = [];

inp.on("line", (data) => { userInput.push(data); });

inp.on("close", () => {

\\MY CODE STARTS HERE

let a = parseInt(userInput[0]);

let b = parseInt(userInput[1]);

if (a < b)

{

console.log(a);

}

else {

console.log(b);

}

});

it throws error the output is nan..it should be smallest number...

Testcase Status:
>>> error
Input:
2 3
Expected Output:
2
Actual Output:
NaN
Execution Time:
>>> 0.072s
Memory Used:
>>> 8280kb
Comments (2)
Please login to comment.
 
Powered by habitate.io Habitate