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.
I tried to submit the following method: public static void main(String args[] ) throws Exception {
/* Enter your code here. Read input from STDIN. Print output to STDOUT */
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));
String s = bufferedReader.readLine(), t = bufferedReader.readLine();
System.out.println(IntStream.range(0, s.length()).mapToObj(i -> String.valueOf(s.charAt(i) ^ t.charAt(i))).collect(Collectors.joining()));
} although it visually presents the same result. It is difficult to understand what the real problem is.
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 →
I tried to submit the following method: public static void main(String args[] ) throws Exception { /* Enter your code here. Read input from STDIN. Print output to STDOUT */ BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in)); String s = bufferedReader.readLine(), t = bufferedReader.readLine(); System.out.println(IntStream.range(0, s.length()).mapToObj(i -> String.valueOf(s.charAt(i) ^ t.charAt(i))).collect(Collectors.joining()));
} although it visually presents the same result. It is difficult to understand what the real problem is.