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.
bruh what happend to hankerrank it feels like a cheap website it wasn't like this before the code isn't working
import java.io.;
import java.util.;
public class Solution {
public static void main(String[] args) {
/* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */
Scanner sc = new Scanner(System.in);
String str = sc.next();
String str2 = sc.next();
String result = xor(str, str2);
System.out.println(result);
}
public static String xor(String str, String str2)
{
StringBuilder s = new StringBuilder();
for(int i = 0; i <= str.length() - 1; i+=1)
{
int num1 = str.charAt(i) - '0';
int num2 = str2.charAt(i) - '0';
s.append(num1 ^ num2);
}
return s.toString();
}
}
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 →
bruh what happend to hankerrank it feels like a cheap website it wasn't like this before the code isn't working
import java.io.; import java.util.;
public class Solution {
}