You are viewing a single comment's thread. Return to all comments →
Using JavaScript, the output is the same as the expected output but still incorrect
process.stdin.resume(); process.stdin.setEncoding("ascii"); let input = []; let output = ""; process.stdin.on("data", function (chunk) { input.push(...chunk.trim()); }); process.stdin.on("end", function () { const firstLine = input.slice(0, input.indexOf('\n')); const secondLine = input.slice(input.indexOf('\n') + 1); for (let i = 0; i < firstLine.length; i++) { output += (firstLine[i] === secondLine[i] ? '0' : '1'); } console.log(output); });
Compiler Message
Wrong Answer
Input (stdin)
10101
00101
Your Output (stdout)
10000
Expected Output
Seems like cookies are disabled on this browser, please enable them to open this website
XOR Strings 2
You are viewing a single comment's thread. Return to all comments →
Using JavaScript, the output is the same as the expected output but still incorrect
Compiler Message
Wrong Answer
Input (stdin)
10101
00101
Your Output (stdout)
10000
Expected Output
10000