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.
for java user
public static String stringsXOR(String s, String t) {
String res = new String("");
for(int i = 0; i < s.length(); i++) {
if(s.charAt(i) == t.charAt(i))
res += "0";
else
res += "1";
}
use this code it will clear as the note in problem suggest to to not delete or add code annd only 3 changes so this will help as i cleared
return res;
}
Cookie support is required to access HackerRank
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 →
for java user public static String stringsXOR(String s, String t) { String res = new String(""); for(int i = 0; i < s.length(); i++) { if(s.charAt(i) == t.charAt(i)) res += "0"; else res += "1"; } use this code it will clear as the note in problem suggest to to not delete or add code annd only 3 changes so this will help as i cleared return res; }