You are viewing a single comment's thread. Return to all comments →
There is probably a problem with NodeJS. Although I find the desired result, I get a wrong answer warning. My code is like this.
process.stdin.resume(); process.stdin.setEncoding("ascii"); var input = ""; process.stdin.on("data", function (chunk) { input += chunk; }); process.stdin.on("end", function () { let lines = input.split("\n"); let str1 = lines[0].trim(); let str2 = lines[1].trim(); let result = ""; for (let i = 0; i < str1.length; i++) { if (str1[i] !== str2[i]) { result += "1"; } else { result += "0"; } } console.log(result) });
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 →
There is probably a problem with NodeJS. Although I find the desired result, I get a wrong answer warning. My code is like this.