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.
You will be missing all the code if you're trying it in C#. I've re-written the problem code from the C++11 example to be similar in C#. You can copy the code below and you can only change up to 3 things.
NOTE: Tests will never pass in C#. Just run your code, check your output with what's expected in that then submit it in C++11 as the changes are the exact same!
usingSystem;usingSystem.Collections.Generic;usingSystem.IO;usingSystem.Linq;namespaceSolution{classSolution{staticvoidMain(string[]args){/* Enter your code here. Read input from STDIN. Print output to STDOUT */strings=Console.ReadLine();stringt=Console.ReadLine();Console.WriteLine(strings_xor(s,t));}staticstringstrings_xor(strings,stringt){stringres="";for(inti=0;i<s.Length;i++){if(s[i]=t[i])res=0;elseres=1;}returnres;}}}
You can browse the posts below for the answers.
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 →
You will be missing all the code if you're trying it in C#. I've re-written the problem code from the C++11 example to be similar in C#. You can copy the code below and you can only change up to 3 things.
NOTE: Tests will never pass in C#. Just run your code, check your output with what's expected in that then submit it in C++11 as the changes are the exact same!
You can browse the posts below for the answers.