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.
- XOR Strings 2
- Discussions
XOR Strings 2
XOR Strings 2
Sort by
recency
|
252 Discussions
|
Please Login in order to post a comment
omg. for JAVA you need to go to java 7 and dont touch anything else, but the 3 places that need to be fixed!
we need to report somehow such awful exercises
for i in range(len(s)): if s[i] == t[i]: res += "0" else: res +="1"
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.
I have checked multiple times, my logic is correct, the output I am printing is also correct but compiler says wrong answer. Any idea? Compiler Message: Wrong Answer Input (stdin) 10101 00101 Your Output (stdout) 10000 Expected Output 10000
C++ test:
do not refactor, just fix three errors. There is a bug somewhere on test backend, it fails tests if submitted under C++20/C++23. If submitted under C++14, it passes all tests. It is a bug on the HR backend, the same code compiled under gcc with C++20 compliance works just fine.