We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Hello, I am solving this with one line of code on JS. I am a new coder so I may be wrong somewhere. I am achieving the correct result in std.out but when i run the test is not passing me. Please let me know if i am missing anything?
process.stdin.resume();
process.stdin.setEncoding("ascii");
var input = "";
process.stdin.on("data", function (chunk) {
input += chunk;
});
process.stdin.on("end", function () {
// now we can read/parse input
console.log(Number(input.split("\n")[0]) ^ Number(input.split("\n")[1]));
});
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
XOR Strings
You are viewing a single comment's thread. Return to all comments →
Hello, I am solving this with one line of code on JS. I am a new coder so I may be wrong somewhere. I am achieving the correct result in std.out but when i run the test is not passing me. Please let me know if i am missing anything?
process.stdin.resume(); process.stdin.setEncoding("ascii"); var input = ""; process.stdin.on("data", function (chunk) { input += chunk; }); process.stdin.on("end", function () { // now we can read/parse input console.log(Number(input.split("\n")[0]) ^ Number(input.split("\n")[1])); });